How to create an action button?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • n7ero
    New Member
    • Sep 2008
    • 1

    How to create an action button?

    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..
  • bnashenas1984
    Contributor
    • Sep 2007
    • 257

    #2
    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.

    Code:
    MY_MC.addEventListener(MouseEvent.MOUSE_OVER, firstFunction);
    function firstFunction(event:Event):void
    {
    	event.target.scaleX = 1.5;
    	event.target.scaleY = 1.5;
    }
    
    MY_MC.addEventListener(MouseEvent.MOUSE_OUT, secondFunction);
    function secondFunction(event:Event):void
    {
    	event.target.scaleX = 1;
    	event.target.scaleY = 1;
    }
    Note: this is an AS3 script

    Comment

    • orlando456
      New Member
      • Sep 2008
      • 4

      #3
      Hi

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

      thanks

      Comment

      Working...