3 Replies Latest reply on May 23, 2010 2:00 PM by Sean_Wilson

    lastClick doesn't work?

    Jhon Carlo Level 1

      I tried  the following behaviors:

      1)

      on mouseUp me
      if the lastClick > 10 * 60 then
          go to frame "3"
        end if
      end

       

      2)

      on exitFrame me
      if the lastClick > 10 * 60 then
          go to frame "3"
        end if
      end

       

      Both doesn't work. Why?

       

      Thanks

        • 1. Re: lastClick doesn't work?
          Sean_Wilson Adobe Community Professional

          The first can't possibly work since you must have clicked the mouse in order to generate a #mouseUp message, meaning the last click will be a matter of milliseconds ago. The second possibly doesn't work because, if you aren't looping on this frameScript (and I don't see a 'go to the frame' command) then at the exact instant the script runs the lastClick condition isn't met.

           

          Why not just add a 'go to the frame' command:

          on exitFrame me
            if the lastClick > 10 * 60 then
              go to frame "3"
            else
              go to the frame
            end if
          end
          

           

          If this doesn't satisfy, perhaps you could describe what you're trying to accomplish.

          • 2. Re: lastClick doesn't work?
            Jhon Carlo Level 1

            Thanks Sean for your kind reply.
            I apologize for  my previous examples. I have not explained well, I already tried with "go to the frame".
            I don't understand this: whenever you  click the lastClick start from zero?
            I am currently  testing the lastCick to insert it into a larger script.

            Thanks again.

            • 3. Re: lastClick doesn't work?
              Sean_Wilson Adobe Community Professional
              I don't understand this: whenever you  click the lastClick start from zero?

              I don't understand where there could be any source of confusion! The docs state:

              returns the time in ticks (1 tick = 1/60 of a second) since the mouse button was last pressed.

              Even the property name is self-explanatory - the time elapsed since the mouse was last clicked. Granted it has to be clicked on the stage window (clicks in other applications aren't registered).

               

               

              The frameScript modification I posted works exactly as expected for me, and I explained why your first #mouseUp example was never going to work. What again is the difficulty you're experiencing?