2 Replies Latest reply on Aug 29, 2007 11:31 AM by clbeech

    Detecting when you leave a frame

    Tolk Level 1
      How can i detect when a particular frame is left? i.e. The user is viewing fram x, they click one of several buttons or perform a particular action which causes the swf to move to a different frame how can i detect when it exits the original frame x?
        • 1. Re: Detecting when you leave a frame
          FlashForumName Level 1
          Sounds like you could add a currentframe check to all of the buttons that change the frame. Right before the frame is changed, check which frame you are in and if it is the original frame, do what you need to do.

          There's a currentFrame property in AS 3.0 as well as _currentframe in 2.0
          • 2. Re: Detecting when you leave a frame
            clbeech Level 3
            I'm not sure I quite understand your question ... if the user clicks a button that will move the playhead ... the playhead will leave the frame then, at that time, playhead gone ...?

            unless you have something else that runs before it moves the main timeline's playhead ... but in that case then, at the end of that action is when the palyhead will leave the frame, place a call there to the item that needs notification ...? You don't really need anything to detect it.