A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: button animation

  1. #1
    Senior Member
    Join Date
    Apr 2001
    Posts
    179
    How do you animate a button after it has been pressed? (i.e. on the hit state). I have dropped an animated mc onto the rollover state and it works perfectly - but you don't get to see the hit state. So how are buttons animated after they are pressed? I know it must be pretty straight foward - you see it all over the net. Any suggestions?
    Thanks for your time,
    Shaka

  2. #2
    Member
    Join Date
    Mar 2001
    Posts
    66
    I'm not sure if this is the most effective method around, but rather than simply using buttons I use three frame movie clips with an invisible button with different actions each time... then when the button is hit you can have it go to frame 3 (which will play your animation) rather than having to hold the mouse button down to see the animation (for a button)

    Hope this helps!

    Cheers,

    motiv

  3. #3
    Senior Member
    Join Date
    Apr 2001
    Posts
    179
    Thanks for the advice motiv - the problem is they really do need to be buttons - I already have some hefty on (release) code on them setting off various colour tweens, parallax scrolling effects etc.. Therefore I'm not sure the 3 key frame method you suggested would work. Any other ideas?
    Thanks again
    Shaka

  4. #4
    Member
    Join Date
    Mar 2001
    Posts
    66
    The only problem is the "hit" state is an invisible state, all it does it specify the active mouse area...

    If you were to place your animation in the 'down' state the user would be able to see it... as long as they held the button down that is.

    If I come up with anything else I'll let you know.

    Cheers,

    motiv

  5. #5
    Senior Member
    Join Date
    Apr 2001
    Posts
    179
    Cheers - surely there's a flash guru out there you knows how to do this?? I've seen it often enough before - just can't figure out how to do it

  6. #6
    Firmly Fastened to the Milk Sac of Misanthropy
    Join Date
    Aug 2000
    Posts
    463
    Hey Shaka,

    I typically drop the button into it's own movie clip. In the first frame I have the button with a stop action. In the 2nd frame, I add a keframe to place a new instance of the button in the same spot, but have turned it into a graphic (or MC) by using the Instance panel. I then create the animation as I see fit. To get it to work, I place the following AS in the button in the first frame:

    on (release) {
    _root.whatever.gotoAndPlay (whatever);
    this.gotoAndPlay (2);
    }

    Does this make any sense? Wanna FLA?

    Sem.

  7. #7
    Senior Member
    Join Date
    Apr 2001
    Posts
    179
    Hi Sem - thanks for your help (again!). I've tried this - and it works perfectly. My site is comming along nicely!
    Cheers
    Shaka

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