First time here? First time here? Newsletter Signup Newsletter
Search tutorials
Author: Nintendorc | Website: http://turkeyfiles.tk
Requirements: Flash MX 2004 Things you need to know: -Variables -the "random()" function. if you don't know enough on variables, you should search for a tutorial about it first, which should be relatively easy to find and understand, and then come back here. if you don't what the "random()" function is, don't fret, it's simple. basically it returns an absolute number value which is equal to the number inserted in the function or less from numbers 0-x where x is the number inserted in the function. e.g.: "random(7)" would give a random number from 0 to 7 excluding decimals, being one of the numbers in the parentheses(0,1,2,3,4,5,6,7). now let's begin. first, with the property inspector open(Ctrl+F3), select the Text Tool(T) and choose "Dynamic Text" from the property inspector. now, with the text tool, make an empty text at wanted size as long as it's big enough to display around 5 characters. now with the Select Tool (V), select the text box you just created. with the text box selected and the property inspector opened, enter "randomnumber_txt" in the "instance name" area, and enter "randomnumber" in the area with the word "Var:" written to it's left. now close the property inspector(Ctrl+F3), open the actions panel(F9), and select the first frame of your movie in the timeline. In the Actions box, insert the following code: //this declares the variables and the "engine" variables random function. var engine = random(99); var randomnumber; //This tells us that you have a 15% chance of getting the number 18 if (engine>=0 && engine<=14) { randomnumber = 18; } else if (engine>=15 && engine<=69) { //This tells us we have a 55% chance of having the number 12 randomnumber = 12; } else { //this is the remainding percentage which is accorded to "9". randomnumber = 9; } now you can test it(Ctrl+Enter). if all is rolling smoothly, you're done. if not, try checking the code or check if you have the right version of flash.
» Level Basic

Added: 2005-05-01
Rating: 4.67 Votes: 12
(10 being the highest)
» Author
Good engine i built since i couldn't find a tutorial for it.
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!


  • There are no comments yet. Be the first to comment!

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: Inocreato
» Title: RaiseTheBlocks
» Description: Raise all the blocks to win the game
Featured Sound Loops
Image for equalize

Audio Player

» Author: TomCat Carty
» Title: The Wood
» Description: Just a little game ending or it can maybe be looped. Recorders with music box and percussion to give the feel of well, I don't know, the woods? Free to use, just credit me. thank you
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: Davisigner
» Description: Hmm... what to say about this one? It's reminiscent of the closing notes of the opening music from the Three Stooges done in a church organ style with a closing cymbal crash. I'll give this one away gratis, but feel free to check out my free loops and potential upcoming license-mandated ones over in the respective part of Flashkit.