frozenpeas
Technical User
Hi all,
I am finally making the switch to AS3 but am having some problems. I think it boils down to a misunderstanding about scope.
public class Main contains:
public class XMLLoader.as contains:
The problem is: I can access xmlData.myArray from my Main class but not from other classes.
For example, if (after xmlData is created) Main.as defines:
I cannot access xmlData.myArray from within the public Game class, even though all the classes reside in the same package. Instead, I get Error 1120: Access or undefined property xmlData.
Can someone help me gain a better understanding of this?
Thanks.
frozenpeas
I am finally making the switch to AS3 but am having some problems. I think it boils down to a misunderstanding about scope.
public class Main contains:
Code:
public var xmlData:XMLLoader = new XMLLoader();
public class XMLLoader.as contains:
Code:
public var myArray:Array = new Array("square","circle","triangle");
The problem is: I can access xmlData.myArray from my Main class but not from other classes.
For example, if (after xmlData is created) Main.as defines:
Code:
public var myGame:Game = new Game();
I cannot access xmlData.myArray from within the public Game class, even though all the classes reside in the same package. Instead, I get Error 1120: Access or undefined property xmlData.
Can someone help me gain a better understanding of this?
Thanks.
frozenpeas