[osflash] MTASC & Preloading
mail@tonio.com
mail at tonio.com
Mon Jul 10 23:35:51 EDT 2006
Hello,
I have a simple Noob question. Sorry if it's been covered.
If I'm building a big AS2 project with MTASC do I need some kind of
preloader? If so what's the best practice?
At a guess I have:
import mx.utils.Delegate;
class MyRun extends MovieClip{
var intID:Number;
function MyRun(mc){
mc.__proto__ = this.__proto__;
mc.__constructor__ = Gogo;
this = mc;
intID = setInterval(Delegate.create(this, preLoad), 100);
}
function preLoad():Void
{
if (getBytesLoaded()==getBytesTotal()){
clearInterval(intID);
postLoad();
} else {
//loading widget
}
}
function postLoad():Void
{
//run
}
public static function main() : Void
{
Stage.align = "TL";
Stage.scaleMode = "noScale";
var doIt:MyRun = new MyRun(_root);
}
}
More information about the osflash
mailing list