A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Animating Buttons

Hybrid View

  1. #1
    Member
    Join Date
    Jul 2002
    Location
    London, England
    Posts
    46

    Animating Buttons

    Does anyone one the how to animate buttons like the top menu buttons, on the Diesel site http://www.diesel.com/.
    Ben

  2. #2
    zephyr Olly K's Avatar
    Join Date
    May 2002
    Location
    The Univerity of Wales, Newport
    Posts
    1,357
    Create a movieclip with the text for the button in it. In a layer above create a mask to fit this text. Make the text layer constrain to the mask by dragging it below the mask layer. Lock and hide the mask layer.

    In the layer with the text in the first frame set the 'stop();' action. In the second frame select the text, copy it and paste it in place. Recolour this second text and move it to the side of the previous text.
    Select the two and convert them to a symbol (graphic or movie clip). Tween them sliding to the left and in the last frame put the 'stop();' action.
    Then in the frame after this tween the symbol going back into place.
    Leave this movie clip and set the instance name to 'text1'.

    Now you need an invisible button, to do this just create a button over the movieclip and put a box the size you want in the Hit stage. Set the actions for the button to:

    Code:
    onRollover{
    tellTarget("text1"){
    play();
    }
    }
    
    on Rollout{
    tellTarget("text1"){
    play();
    }
    }
    If using the play command doesn't work then label the frames and use the 'gotoAndPlay("frame name");' command instead
    - I made this!
    http://www.okkle.co.uk - creatures, art, animation and toys!
    Toilet Trumps

  3. #3
    Member
    Join Date
    Jul 2002
    Location
    London, England
    Posts
    46
    Thanks for replying to my post. You advice was very helpful
    Ben

  4. #4
    zephyr Olly K's Avatar
    Join Date
    May 2002
    Location
    The Univerity of Wales, Newport
    Posts
    1,357
    No probs, but I just realised a slight mistake it should be:

    on(rollover) not onRollover, same for rollout
    - I made this!
    http://www.okkle.co.uk - creatures, art, animation and toys!
    Toilet Trumps

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center