dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Disabling buttons

  1. #1
    Senior Member
    Join Date
    Aug 2000
    Posts
    193

    Disabling buttons

    How do I disable a button (or a mc with a button in it) once the action has been performed?

    For example: Info button is clicked, info slides into view, then you want the info button disabled so people can't keep playing that same movie again and again, before visiting somewhere else.

    Thanks.

  2. #2
    Member
    Join Date
    Oct 2002
    Posts
    61
    Once the movie is loaded or the action is done. Use an if statement and you could make the button not visible. Or put an if statement in the button that uses the movies current frame. So you could put if movie.current_frame =1 then play, if movie.current frame !=1 then show movie frame saying click somewhere else would ya!!!
    This is not actual code because I am too lazy.

    Do you understand what I am saying and know how to do this?
    I can always use more help!

  3. #3
    Senior Member
    Join Date
    Aug 2000
    Posts
    193
    I understand you, unfortunately it's been 2 years since I even looked at any code, and even then it was beginner's stuff. So I am not exactly proficient with my use of actionscript.

    I guess I'll have to dive back into it... unfortunately time is a problem...

  4. #4
    Senior Member Jaffasoft's Avatar
    Join Date
    Apr 2001
    Location
    On Travel
    Posts
    1,587
    I think you should dive back into it , since time is a problem i have done this one this time. Now when i thought about it there is a couple of senario's you could get yourself into here.
    I imagine that you will want other buttons or evan if there's one it will stil work.

    1) one senario is if you want one button disabled while that section is playing and disable the rest. Cant press on that button again but can press on other button, the last one that was pressed is enabled again once a new button is presssed on.

    OR

    2). Disable all the buttons and until the current mc section has finished, then enable all buttons again.

    OR

    3). You could have to disable any button thats been pressed one and never enable it again, so therefor only sections that you can go to are sections that haven't been to before.

    I went all out and made an example fla.
    I thought it worth while and that i may want to use the same sometime!Since i thought i could get myself into the same situation.
    Attached Files Attached Files

  5. #5
    Senior Member
    Join Date
    Aug 2000
    Posts
    193
    Many thanks!! Quite kind of you.

    I honestly don't really care too much about it (when you click a button and it replays the same movie). I'd guess most people don't, and I've only seen/noticed a few sites that did this.
    It was my client (who is a programmer - js, and older things) wants things to be particular and doesn't understand how flash works (he tries to create a rationale similar to regular programming - not that those analogies are always incorrect, I just have to explain that flash is 'good', it's just different). He wants complete control over everything.

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