Link to home
Start Free TrialLog in
Avatar of AbeDajani
AbeDajani

asked on

Animating a button in AS3 - on Roll over and roll out

Hello,

Please view attached and advise over the following:
Attached is an image of the navigation menu i'm trying to create. What i have done so far is creating the vector cards and placing them on the stage. i need the script that does the following scenario:
when mouse over any of the 5 cards, the card moves and stops, when roll out, animation is reversed and  card moves back to its original state.
The hit area should be the card whether the user clicks on the card during the motion tween or when it reaches the last frame where it stops.
It seems like a simple thing to do, it's been a while since i've worked on flash, let alone that i have no experience with CS3.

I'll appreciate your prompt reply and help
Screen-shot-2011-03-07-at-2.17.5.png
Avatar of gingermoleman
gingermoleman

Hi there,

How have you put these on stage? Library object or created in the as3?

Basically you need 2 event listeners and a tween, so something like

Var myTween: Tween =new tween(//details of tween);
MyTween.stop();
MenuitemA.addEventListener(mouseevent:mouse_over, do_over_anim);
MenuItemA.addEventListener(mouseevent:mouse_out,do_out_anim);
Function do_over_anim(e:mouseevent):void{
MyTween.play();
}
Function do_out_anim(e:mouseevent):void{
MyTween.revese();
}

Gmm
Avatar of AbeDajani

ASKER

Thanks for your reply,

Each card is a grouped vector and text (graphic only), created in Illustrator then imported to Flash. So if you can bear with me as i am not familiar with flash CS.. can you guide me step by step:
1- the cards are graphics only, shall i convert them each into buttons or movie clips?
2- what are the replaceable names in the script above?
3- what do you mean by "details of tween"?

thanks a million
No worries, here to help.
One question for you before we start, is the number of cards being displayed known?
Yes, just like the attachment.. 5 cards
ASKER CERTIFIED SOLUTION
Avatar of gingermoleman
gingermoleman

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.