1
votes

So I have a custom preloader with 200 frames and the corresponding in Flex:

gotoAndStop(Math.ceil(e.bytesLoaded/e.bytesTotal*100));

So basically each procent is one frame in the movieClip. So when 100% the movie ends and application initializes.

How can I say for example so that when 100% don't start the app but play from frame 100-200 in the movieClip and then initialize the app?

Thanks,

1
Are you calling goToAndStop in an event handler for "enterFrame"?Shakakai
It's onProgress(e:ProgressEvent)Yan

1 Answers

1
votes

How about adding an event listener when loading is complete, then displaying the MovieClip frame one after another from 100-200. When that is done, you can dispatch the complete event.

private var _currentFrame:int;

private function initComplete(e:Event):void
{
    _currentFrame = 100;
    addEventListener( Event.ENTER_FRAME, onEnterFrame );
}

private function onEnterFrame( e:Event ):void {
    if ( _currentFrame < 200 ) {
        _currentFrame++;
        cp.gotoAndStop( _currentFrame );
    } else {
        removeEventListener( Event.ENTER_FRAME, onEnterFrame );
        dispatchEvent(new Event(Event.COMPLETE));
    }
}