2 Replies Latest reply on Sep 13, 2007 2:11 PM by Newsgroup_User

    Double Click Button Question

    kcSTL Level 1
      I am interested in using actionscript with a button to turn labels on an image slide in flash on and off. I would like to have only one button ("labels") that upon first click and release will advance to the labeled portion of the slide timeline and upon a repeat click and release will return to the unlabeled portion of the slide timeline.

      Any help would be greatly appreciated.
        • 1. Re: Double Click Button Question
          kglad Adobe Community Professional & MVP
          in as3, there's an double click event. in as2, you must code it yourself: there's sample code to do this on the adobe website. (use google to find it.)
          • 2. Re: Double Click Button Question
            Level 7
            Hmmm... doesn't sound to me like you're actually wanting to check for a
            double-click. Basically you want a play/pause button... you click it once it
            does one thing, you click it again it does another. You can do that with a
            simple state flag:

            var clickState:Boolean = true; //default

            myButton.onRelease = function(){
            clickState != clickState;

            function checkState(){
            //do one thing
            //do another thing

            When you click, the clickState variable changes from true to false, or false
            to true, and then you call checkState() which does something based on the
            state of that variable.


            Dave -
            Head Developer
            Adobe Community Expert