I am having trouble with implementing this. Basically, I have many large chunks of data that need to load with URLoader. And I want to use lazy loading because eager loading takes up a lot of network resources/time. For example:
class Foo {
private var _resources:Array;
public get_resource(id:String){
if ( _resources[id] == null ){
//Load the resource
}
return _resources[id];
}
}
However, the above code only works with synchronous loading. I don't want the asynchronous being exposed to other parts of the program. How do I do this? Thanks.