Inser code hack advice

DoctorMikeReddy

  • *
  • Posts: 180
With the new version, additional commands are added at the end of the init function:

         addWhenUpdatedListener(null, update);
         addWhenDrawingListener(null, draw);

We used to be able to use a code block at the end of WhenCreated to add our own code with the following stuff:

}
// this artificially ends the init function definition
//Add our own code here, which is now at the level of the whole package


Now, with the above extra commands if you need to do this hack, try this:

fake_init();
}
// Your code here

private function fake_init():void {

What this does is allow the above Listeners to still be part of init(), but allow our own code to be easily added to Block code scripts.

Hope it was useful.
P.S. I'm sure there are other better ways to do this, but Nature will find a way...