-
[as3]event for change of frame
hello everybody,
Is there any event to listen for change of frame.Actually i cant access the timeline varibles of frame 2,3 & so on, in my .as file
-
Registered User
hi,
No there isn't, but you can use Event.ENTER_FRAME to keep track of the current and last frame and detect whether they are different or not, i.e., whether there has been a change of frame.
Actionscript Code:
addEventListener(Event.ENTER_FRAME, checkFrame);
var lastFrame:uint;
function checkFrame(e:Event):void { if (lastFrame != 0) { if (lastFrame == currentFrame) { trace("same frame"); } else { trace("different frame"); } } lastFrame = currentFrame; }
-
Thanks, again a great help
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|