Does anyone know whether there is an event fired when an object is
instantiated ? I have objects that are created from an sqlite SQLEvent
result. Presently I'm iterating over the results and calling the
populateBar function manually, but it would be nice for the object to
detect its been created and dispatch an event automagically.
The Event.ACTIVATE event sorta works but only if u move focus out of the
AIR app and then back to it again. This is the code i have been working
with sofar....
package
{
import flash.events.Event;
import flash.events.EventDispatcher;
[Bindable]
public class Foo extends EventDispatcher
{
public function Foo()
{
super();
this.addEventListener(Event.ACTIVATE,fooLoadedHandler);
}
public function fooLoadedHandler(event:Event):void
{
if(this.bar==null) this.populateBar();
this.removeEventListener(Event.ACTIVATE,fooLoadedHandler);
}
public var bar:Bar;
private function populateBar():void{
//.. this.bar = stuff
}
}
}
any comments would be greatly appreciated, maybe even an alternative
strategy..
Cheers
Vaan