Search tutorials
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 its 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 backgrounds alpha to that value. (If you dont 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, youll notice that 100 alpha is solid, and 0 is completely transparent (not visible). On the next page, well 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. |
Download (30 kb) |
» Forums |
More help? Search our boards for quick answers! |