/ Published in: ActionScript
Let's say you want to place a Preloader in a frame before the actual Flash app or in a previous Scene, this is a really simple, ghetto way of doing it.
Expand |
Embed | Plain Text
var total:Number; var loaded:Number; this.onEnterFrame = function() { total = _root.getBytesTotal(); loaded = _root.getBytesLoaded(); if(loaded >= total){ delete(onEnterFrame); gotoAndStop(nextFrame()); } }; stop();
Comments
Subscribe to comments
You need to login to post a comment.

Why Delete the frame? Put a Movie Clip of your loader of choice on the first frame : in your actions frame put this ...
var total:Number; var loaded:Number;
this.onEnterFrame = function() { total = _root.getBytesTotal(); loaded = _root.getBytesLoaded(); if(loaded >= total){ gotoAndPlay(nextFrame());
} }; stop();
Hey UltraMegaPancake, Thanks for the tip. The reason I delete the onEnterFrame is show intention. Plus, I never ever ever have to worry about some process like onEnterFrame potentially eating memory.
C