Need help with flash 8 actionsript using the tween class
Posted on 2007-10-01
Ok, just to be clear - I'm a complete neophyte with programming in general and actionscript specifically.
I have a simple graphic on my stage that I want to have fade in or out with actionscript. I want to place actionscript in the timeline to control when I want this item to fade in and when I want it to fade out. Beyond that I'm clueless as to how to make that happen.
I found the script I've pasted below, which seems to do what I'm looking for - but it is controlled by a mouse rollover - not a specific timeline occurrence.
I'm hoping someone could help me to change this script (and tell me how to use it on the timeline) so that I can have my graphic fade in and out when I need it.
Thanks a million, in advance, for any and all help with this.
Here is the script I found:
//first import the class libraries
//now initialize the tween object
myButton.alphaTween= new Tween(myButton, "_alpha", Regular.easeOut, 50, 50, .3, true);
myButton.onRollOver = onRollOverHandler;
myButton.onRollOut = onRollOutHandler;