Hi Jim,
Don't think you can get around listening to for the event unless you
want to get into callbacks...
How's this though? Requires GDispatcher in the Model.
---------------------------
class AbstractWidget {
var localData:Array;
var provider:Model;
var build:Function; //<--child method
function AbstractWidget(){
provider = Model.getInstance();
if (provider.ready == true){
build();
} else {
provider.addEventListener("ready", this, "onDataLoad");
}
}
function onDataLoad():Void
{
build();
provider.removeEventListener("ready", this, "onDataLoad");
}
}
----------------------------
class ConcreteWidget extends AbstractWidget {
function ConcreteWidget() {
super();
}
function build():Void
{
localData = provider.getGenericWidgetInfo();
//initialize
}
}
---------------------------------
Of course if all the widgets share the same data till death then
localData needs to be static.
Tony
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com