Posts: 457
Name: Randy
Location: Northern Wisconsin
|
Hoping there are some AS3 helpers here.
I am very new to actionscript 3.0 so please bare with me!
I have 2 classes Main.as and RedPawn.as (yes, in the same folder).
I am wanting to check if a child exists on a movie clip in Main.as through RedPawn.as.
This is within a for loop since I am checking 24 possible values for _dest until I find a match.
This minified code example would be in the RedPawn class:
Code:
_dest = 'example_mc'; // example_mc is normally pulled from an array
if ( MovieClip(root)._dest.numChildren < 2 ) { // do stuff; }
Error:
Property _dest not found on Main and there is no default value.
I am assuming the code thinks I am looking for a variable that is within the Main.as class(?) but this variable is in the RedPawn class.
Is there a way to traverse this properly so it uses the _dest var set in this RedPawn.as class? For testing, I hard coded the _dest var then it worked fine.
Thanks so much!
Last edited by racer x; 02-12-2010 at 03:23 PM..
|