Link to home
Create AccountLog in
Avatar of chevronrod
chevronrodFlag for United States of America

asked on

How to play nested movieclip with name assigned by variable

Flash CS4; AS3.

Here is my code:

import flash.display.StageDisplayState
 
stage.displayState = StageDisplayState.FULL_SCREEN;

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?
Avatar of dgofman
dgofman
Flag of United States of America image

You can pass URL(s) via HTML when embedding your player using flashvars
or download test/xml file and add url into file
Avatar of chevronrod

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.
ASKER CERTIFIED SOLUTION
Avatar of dgofman
dgofman
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
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.