Answered
listeners, variables and properties
Hi.
All code is from the 1st frame of the main timeline.
In my .swf I attached several instances of a MC to the main timeline:
for (k = 1; k <= nTotalMCs ; k++) {
attachMovie("id1", "mc"+k, _root.getNextHighestDepth(), this["o"+k]);
trace (this["mc"+k]); //returns _level0.mc1, _level0.mc2,..., _level0.mc3
}
I have a programatic tween and I have added listeners to handle events related to it. This is one of them:
oListener01.onMotionChanged = function():Void {
for (j=1; j<=nTotalMCs; j++) {
trace (["mc"+j]); //returns mc1, mc2,..., mcN
trace (this["mc"+j]); //returns undefined
trace (this._parent["mc"+j]); //returns undefined
trace (_root["mc"+j]); //returns _level0.mc1, _level0.mc2,..., _level0.mcN
}
};
I need to access those MCs from the listner, but I can't use _root because the .swf this is in is going to be loaded by other .swfs, so I need to use relative paths. Can anyone tell me what I'm doing wrong and how to get the correct relative path? Thank you in advance.
All code is from the 1st frame of the main timeline.
In my .swf I attached several instances of a MC to the main timeline:
for (k = 1; k <= nTotalMCs ; k++) {
attachMovie("id1", "mc"+k, _root.getNextHighestDepth(), this["o"+k]);
trace (this["mc"+k]); //returns _level0.mc1, _level0.mc2,..., _level0.mc3
}
I have a programatic tween and I have added listeners to handle events related to it. This is one of them:
oListener01.onMotionChanged = function():Void {
for (j=1; j<=nTotalMCs; j++) {
trace (["mc"+j]); //returns mc1, mc2,..., mcN
trace (this["mc"+j]); //returns undefined
trace (this._parent["mc"+j]); //returns undefined
trace (_root["mc"+j]); //returns _level0.mc1, _level0.mc2,..., _level0.mcN
}
};
I need to access those MCs from the listner, but I can't use _root because the .swf this is in is going to be loaded by other .swfs, so I need to use relative paths. Can anyone tell me what I'm doing wrong and how to get the correct relative path? Thank you in advance.
