A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Pressed and unpressed button state

  1. #1

    I am creating a navigation with 5 buttons. I would like to have the button stay pressed when pushed and go back to its original state when a different button is pressed. How can this be achieved? I am having trouble communicating with that MC that creates the effect when I push other buttons.

    Thanks in advance

  2. #2
    Senior Member tigersbite's Avatar
    Join Date
    Apr 2002
    Posts
    314
    Just the way I'd do it....
    Each button would be a movie clip with a button (hit state only) within it to handle the click events.
    I'd pass a reference to the movie clip I've pressed back to the main timeline through a function call. The function would use tellTargets to instruct the clip I've just clicked to play the "pressed" animation, and tellTarget to instruct the previously "pressed" clip to play the "unpressed" animation.
    I could send you a sample if you'd like.

  3. #3
    Stick In The Mud
    Join Date
    Oct 2000
    Posts
    752
    Tigersbite,
    i'd do it exactly the same way....spooky

    http://www.subkloda.freeserve.co.uk/stickybut.html

    Above is an example with the source..

    There's a button container (does the button state swapping) and each button inside the container is a MC consisting of 2 frames (on/off) with a button (hit state) over it..

    when you press a button it passes a reference of itself to the button container (which has 2 variables for storing the old & new button reference) which then sets the state of the of the button MC by going to a particular frame.

    Hope this helps,
    Andy

  4. #4
    tigersbite,

    I am having a hard time understanding what you are saying. Could you send me a file if you have or maybe take a look at the actual file I am working with at http://www.id72.com/menu.htm

    Thanks

  5. #5
    Senior Member tigersbite's Avatar
    Join Date
    Apr 2002
    Posts
    314
    I couldn't get your .fla to open. Keeps giving me a "Invalid Format" message. I'm, going to emulate what you have your page and send you the source.

  6. #6
    tigersbite,

    I know why you got a invalid format. I asume you are using flash 5 and I have saved that file in flash mx format. Sorry about that I have resaved it in Flash 5 format and it should work now.
    Check out this new link http://www.maloman.com/menu.htm

    Thanks man.

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