A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: How to disable a button/action after a single click?

Threaded View

  1. #1
    Junior Member
    Join Date
    May 2008
    Posts
    4

    How to disable a button/action after a single click?

    So what im trying to do is have a few buttons that when pressed go to and play a movie symbol at keyframes throughout the timeline.

    Say there was a picture of a man, and you click button A and the picture zooms in on the mans head, button B zooms in on his hand and button C zooms in on his foot.
    I have all the motion tweening setup and all the buttons work via AS3 using gotoandplay, and there is a stop at each step of the way.

    Thats all fine, it works perfectly, however the only issue I have is, say you click button A it plays the part that zooms in on his head, but if you click A again buring the tween/playback it goes back and starts playing again.
    Basically what im after, is once you click a button, it becomes no longer clickable untill it gets to next step.
    I can disable the button symbol itself using the buttonA.enabled=false; but as the script is on a seperate layer, that doesnt do anything at all. It just stops the button from being a button.. the area ist sitll clickable due to the script. And you cant put scripts within the buttons themselves.

    The script im using is
    menubutton1.addEventListener(
    MouseEvent.MOUSE_UP,
    function(evt:MouseEvent):void {
    gotoAndPlay(2);
    }
    );


    So is there anyway of disabling the gotoand play function between the keyframes. So that if the button is clicked during the tween/playback it doesnt do anything?
    I have tried putting a script on the next frame, that doesnt have the gotoandplay portion but that didnt do anything.

    (sorry thats a right mess, hope it all makes sense.)

    <edit>
    I have tried what is mentioned here..http://board.flashkit.com/board/showthread.php?t=766152
    But it doesnt seem to be working, perhaps im not putting in the script right or putting it in the wrong spot. As the buttin is still perfectly clickable.

    I have keyframe every 15 frames, which has action script in it. to control what the buttons do on that frame.
    Last edited by DaForce2000; 05-04-2008 at 10:19 AM.

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