Hi,
I apologise for what is ostensibly a very basic question but could someone let me know or point me in the direction of some info on the flow of control throughout an Actionscript 3.0 class?
I’m developing an enhanced version of an ecommerce app and was trying second time around to do everything nice and cleanly (like you see in tutorials :esmirk: )
I have a constructor method which is calling a getData method that takes in URL encoded data and populates Arrays with it, I then wanted to continue in the constructor doing things but it seems like the getData method is called only after everything in the constructor is executed.
var cube_fsc:Array;
var cube_name:Array;
var cube_sku:Array;
public function FlashBlock() {
var request:URLRequest = new URLRequest("flashbox_load.asp?startload=1");
getData(request);
trace(cube_name[0]);
}
the trace statement here tells me that my Array is null or undefined because it is executed before the getData method for some reason. That is what I would like to understand, why it’s executed before the getData method has completed. Previously I have just continued my work in the handleComplete method which is called by the getData method and that seemed a little topheavy and messy to me. Any help is greatly appreciated.
Thanks,
A confused Java programmer