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
Printable View
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
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