A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: A button question!

  1. #1
    Member
    Join Date
    Nov 2002
    Posts
    40

    A button question!

    I guess this relates more to the graphics of a button than ActionScript, but I'm not sure how to do this and since it might end up involving AS, I'm asking here

    Anyways... how do I create a button(s) like this:
    1. It is a toggle button: it turns something on or off... (this isn't the question )
    2. So, I want it to just be a button that starts saying "ON". When somebody clicks it once, it turns to "OFF". Click it again, it turns to "ON", unto infinity. I can't figure out how to do this with the Button Symbol hit states... it can go to "OFF" when clicked, but how do I reset it to "ON" when clicked again, then to "OFF" if clicked a third time, etc.?

    Sorry if this an awfully dumb question - it kind of feels like one But, anyways, if any of ya have a quick fix, lemme know

    - wobbly

  2. #2
    Welcome to flavour country
    Join Date
    Sep 2000
    Posts
    662
    You could make two buttons, one saying 'ON' and the other saying 'OFF' and then put them in a two frame movie clip. Put the 'ON' button in the first frame and the 'OFF' button in the second.

    The the 'ON' button would direct the movie clip to go to and stop on frame 2

    Code:
    on(release){
    nextFrame();
    }
    and the 'OFF' button would direct the movie clip to go to and stop on frame 1

    Code:
    on(release){
    prevFrame();
    }
    and don't forget to put a stop action on the first frame of the movie clip.

    Hope that helps.

  3. #3
    Member
    Join Date
    Nov 2002
    Posts
    40
    That worked perfectly! Thank you for your help.

    - wobbly

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