Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
12-10-2012, 05:25 PM #1
- Join Date
- Feb 2005
- Bradford, UK
- Thanked 65 Times in 64 Posts
Why can one class access root variables but another can't?
root.somepropertyofmain works in every class in my project (so far) except one. If I trace root from within both say [object main] but one of my classes wont let me access the main variables - it gives a compile error: Access of possibly undefined property name through a reference with static type flash.displayisplayObject.
The property I'm trying to access is not undefined.It is declared and a value assigned to it in the class definition of Main.as, I cannot attempt to access any root variables from within this class, even ones that work in other classes.
The class that doesn't work is a class that is totally written in actionscript, when the app is run a movieclip (swatch_group) creates a bunch of these movieclips (paint_sample) within itself . When a paint sample is clicked it needs to know which item to apply itself to, which is a string stored in Main.as
It will let me do this:
Last edited by NancyJ; 12-10-2012 at 05:37 PM.