Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import fl.transitions.Tween;
- import fl.transitions.easing.*;
- // Dont duplicate the things above
- // Start value for the button. buttonOne is the instance name of the button. Alpha is between 0 and 1 so 50% is 0.5
- buttonOne.alpha = 0;
- buttonOne.addEventListener(MouseEvent.MOUSE_OVER, fadingInButtonOne);
- buttonOne.addEventListener(MouseEvent.MOUSE_OUT, fadingOutButtonOne);
- //buttonTwo.alpha = 0;
- //buttonTwo.addEventListener(MouseEvent.MOUSE_OVER, fadingInButtonOne);
- //buttonTwo.addEventListener(MouseEvent.MOUSE_OUT, fadingOutButtonOne);
- //Read about the Tween class here if you want. There is alot that can be changed to the fade
- // http://www.republicofcode.com/tutorials/flash/as3tweenclass/
- function fadingInButtonOne(event: MouseEvent): void {
- var myTween = new Tween(buttonOne, "alpha", Regular.easeIn, 0, 1, 15, false);
- stop();
- }
- function fadingOutButtonOne(event: MouseEvent): void {
- var myTween = new Tween(buttonOne, "alpha", Regular.easeIn, 1, 0, 15, false);
- }
- //function fadingInButtonOne(event: MouseEvent): void {
- // var myTween = new Tween(buttonOne, "alpha", Regular.easeIn, 0, 1, 15, false);
- // stop();
- //}
- //function fadingOutButtonOne(event: MouseEvent): void {
- // var myTween = new Tween(buttonOne, "alpha", Regular.easeIn, 1, 0, 15, false);
- //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement