Hi,

I am new to Flash, and have tried searching numerous forums to the answer to this question, but nothing I try seems to work. Basically I am trying to create a single file that triggers different animations when you mouse over different invisible buttons located on specific areas. The technique I am using is basically spacing out the animations over different frames, and using the gotoAndPlay command specifying the where the relevant animation is located.

Here is the code from my actions layer with two animations:

PHP Code:
stop(); /*This ensures no animations are playing on the first frame*/
 
 
/*Mouse over event for redbutton1*/
 
redbutton1.addEventListener(MouseEvent.MOUSE_OVERfl_MouseOverToGoToAndPlayFromFrame_2);
 
function 
fl_MouseOverToGoToAndPlayFromFrame_2(event:MouseEvent):void
{
     
gotoAndPlay(2); /*This is the frame where the animaton triggered by redbutton1 is located*/
}
 
 
/* Mouse Out Event for redbutton1*/
 
 
redbutton1.addEventListener(MouseEvent.MOUSE_OUTfl_MouseOutHandler_3);
 
function 
fl_MouseOutHandler_3(event:MouseEvent):void
 
{
     
gotoAndPlay(1/*takes animation back to the start of timeline where it stops*/
}
 
 
 
/*Mouse over event for bluebutton1*/
 
bluebutton1.addEventListener(MouseEvent.MOUSE_OVERfl_MouseOverToGoToAndPlayFromFrame_2);
 
function 
fl_MouseOverToGoToAndPlayFromFrame_2(event:MouseEvent):void
{
     
gotoAndPlay(30); /*This is the frame where the animaton triggered by bluebutton1 is located*/
}
 
 
/* Mouse Out Event for bluebutton1*/
 
 
bluebutton1.addEventListener(MouseEvent.MOUSE_OUTfl_MouseOutHandler_3);
 
function 
fl_MouseOutHandler_3(event:MouseEvent):void
 
{
     
gotoAndPlay(1/*takes animation back to the start of timeline where it stops*/


The problem that I can't solve is how to fade the animations out instead of having them abruptly stopping. Also then the animation will need to reset so that if the person mouses over the same button, the animation begins again from the start. Note: the animation doesn't have to play till the end, it basically only plays while the mouse is over, and whatever point the person moves the mouse off, it should fade off at that point.

Please, any help would be greatly appreciated. I'm tearing my hair out over this, yet I feel like there is probably some really easy solution. I have tried fiddling around with Tweenlite and tween class, but I don't know how to get the animation to play and fade out.