I am embedding SWF into my Flash Develop class.
I create an instance of it and add it to stage. It appears.
I try to check currentFrame but the trace reveals 0 at all times.
[Embed(source = '../../../gameshed/logo_integration/_flash/logo.swf')]
private var GSMainTimeline:Class;
public var gslogo:MovieClip;
public function GSSplash()
{
gslogo = new GSMainTimeline();
gslogo.scaleX = 0.65;
gslogo.scaleY = 0.65;
gslogo.y = 60;
gslogo.addEventListener(Event.ENTER_FRAME, onLogoEnterFrame);
gslogo.play();
addChild(gslogo);
}
private function onLogoEnterFrame(e:Event):void
{
if (e.target.currentFrame >= e.target.totalFrames)
{
FlxG.switchState(JWSplash);
gslogo.removeEventListener(Event.ENTER_FRAME, onLogoEnterFrame);
}
}
What am I doing wrong?
I recurrently have this issue with SWF preloaders.