Connecting Tech Pros Worldwide Help | Site Map

How to create an action button?

Newbie
 
Join Date: Sep 2008
Posts: 1
#1: Sep 23 '08
Pls. send me sample files or instructions on how to make an action button like when it hovers, it will go bigger, move or rotate. I have tried many times, but it doest work. I used frame labeling, motion tweening, rollover and rollout. What else should I add?

Specifics: 1. Button = My picture 2. on (rollOver), it will zoom in. on (rollOut), it will go back to its original state.

I will really appreciate it if someone can make it work. Thank you..
Familiar Sight
 
Join Date: Sep 2007
Posts: 207
#2: Sep 24 '08

re: How to create an action button?


Hi
I'm not sure if I understand you correctly because this is one of the first things you learn on AS.

Here's what you can do:
Lets say you have a movie clip on the first frame called MY_MC
All you have to do is to go to the action panel on the first frame and add this code.

Expand|Select|Wrap|Line Numbers
  1. MY_MC.addEventListener(MouseEvent.MOUSE_OVER, firstFunction);
  2. function firstFunction(event:Event):void
  3. {
  4.     event.target.scaleX = 1.5;
  5.     event.target.scaleY = 1.5;
  6. }
  7.  
  8. MY_MC.addEventListener(MouseEvent.MOUSE_OUT, secondFunction);
  9. function secondFunction(event:Event):void
  10. {
  11.     event.target.scaleX = 1;
  12.     event.target.scaleY = 1;
  13. }
  14.  
Note: this is an AS3 script
Newbie
 
Join Date: Sep 2008
Posts: 4
#3: Sep 24 '08

re: How to create an action button?


Hi

thanks for the code. that will surely helpful for me.

thanks
Reply