[osflash] main 1 frame later

JesterXL jesterxl at jessewarden.com
Mon Jun 27 17:42:34 PDT 2005


I'm confused on best practice, please enlighten me.

This works in MTASC 1.04:

import com.rbx.scribbles.controller.shell.Mofo;
var depend:Mofo;
delete depend;

this.__proto__ = _global.com.rbx.scribbles.controller.shell.Mofo.prototype;

_global.com.rbx.scribbles.controller.shell.Mofo.apply(this, null);// call 
constructor

if(this.calledOnLoad == false)
{
 this.onLoad();
}

And then in the class:

static public function main():Void
{
}

public function init():Void
{
   // sets up variables
}

public function onLoad():Void
{
    // loads additiona GUI
}


This doesn't work in MTASC 1.08 because main is called 1 frame after init & 
onLoad.  Now, ordinarely this'd be ok, but for some reason, my init and 
onLoad aren't getting called twice, but I swear they are running more than 
once, even though I have an if then in there preventing it.  I can see 1 of 
the controls duplicated if it make it _alpha = 50; for some reason, another 
one is beneath it.

Anyway, I guess I don't understand the frame lapse that was implemented. 
1.04 works fine, and the technique above allows it to work in Flash or 
MTASC; it seems I'll have to modify the above to work with 1.08, but it will 
no longer work in Flash.

So, again, what are the best practices for this stuff and why the 1 frame 
lapse before calling main?

Thanks if you can help.

--JesterXL 





More information about the osflash mailing list