Monday, April 11, 2011

Flash play() processed immediately?

Does the play() function in Flash:

  1. move the playhead of the MovieClip to the next frame -- as soon as play() is called
  2. change the MovieClip's state to "playing" -- actually move MovieClip to next frame, when movie moves to next frame
From stackoverflow
  • I think its 2. change the MovieClip's state to "playing"

    grapefrukt : I agree, everything that's on the current frame will still be available until it that frame "ends" and the next one is displayed.
  • In normal circumstances it would be option 2. However, it is possible to have the frame re-drawn immediately. There is a catch though, you can only do this within mouse move and timer interval handlers. In AS3 have a look at the MouseEvent.updateAfterEvent and the TimerEvent.updateAfterEvent methods. In AS 2 there is a global updateAfterEvent function you can call with the same restrictions.

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.