First time here? First time here? Newsletter Signup Newsletter
Search tutorials
Author: Sportzguy933

Example 2

Let's say I wanted the user to be able to set the alpha of my background. Create a new Flash document, and make a red box that covers your entire stage (550 x 400 by default). Convert it to a movie clip, and make the instance name “Background”, and make sure it’s coordinates are X=0. Then make a new layer. Make a static text box that says "Enter Alpha Here:" and then an input text box. (Be sure that the text box background property is enabled so that you can see it). Lastly make a rectangular button under that input text box. Make the variable name of that input text box “newAlpha”. Now click the button and press F9 to open the actionscript panel, and place this script: on (release) { if (newAlpha != “”) { Background._alpha = newAlpha; } } Basically, we are telling Flash then when the user clicks that button, check to see if the user inputted a value. If they did, then set the background’s alpha to that value. (If you don’t know how to use variables or dynamic/input text boxes, please read a tutorial on it, as it will serve you VERY well ;-). Alright, so now you should have a small app that lets the user change the transparency (alpha) of the background when they click the button. If you play around with this for a bit, you’ll notice that 100 alpha is solid, and 0 is completely transparent (not visible). On the next page, we’ll take a look at another method of controlling Alpha.
» Level Basic

Added: 2007-03-29
Rating: 6.73 Votes: 11
» Author
If you need any help, please feel free to email me: sportzguy955@gmail.com
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!
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.