chevronrod
asked on
How to play nested movieclip with name assigned by variable
Flash CS4; AS3.
Here is my code:
import flash.display.StageDisplay State
stage.displayState = StageDisplayState.FULL_SCR EEN;
var mcName:String = new String();
var mcTextName:String = new String();
var i:Number;
LoadIntroWords();
function LoadIntroWords():void{
for (i = 1;i <= 5;i++)
{
nestedClip = "introDText" + i ;
mainClip = nestedClip + i + "_mc";
this[mainClip].nestedClip. play();
}
}
(Well, basically. I simplified it with some names that make sense but this should give the idea.)
I want to cycle through 5 nested movieclips (introDText1 inside of introDText1_mc, etc.).
I can't get them to play. How would YOU write this code to make it work?
Here is my code:
import flash.display.StageDisplay
stage.displayState = StageDisplayState.FULL_SCR
var mcName:String = new String();
var mcTextName:String = new String();
var i:Number;
LoadIntroWords();
function LoadIntroWords():void{
for (i = 1;i <= 5;i++)
{
nestedClip = "introDText" + i ;
mainClip = nestedClip + i + "_mc";
this[mainClip].nestedClip.
}
}
(Well, basically. I simplified it with some names that make sense but this should give the idea.)
I want to cycle through 5 nested movieclips (introDText1 inside of introDText1_mc, etc.).
I can't get them to play. How would YOU write this code to make it work?
ASKER
I can look into that. It's all pretty new to me what you said but I recognize the terms. I'll have to dig further to see how to implement that.
Also, this is a stand-alone flash. It will not be on a website.
Also, this is a stand-alone flash. It will not be on a website.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Wow. O.K. I'd have never have come up with that in a million years. I'll try it and see if I can get it to work.
or download test/xml file and add url into file