Jump to content
Search Community

Nested Movie Clip Within For Loop

Buzzafett test
Moderator Tag

Recommended Posts

I have three icons, icon_mc1, icon_mc2, icon_mc3 within page1_mc which is in pages_mc.

 

The following code works with icons on the stage, but this["pages_mc.page1_mc.icon_mc+i] doesn't.

 

Any idea how I can get this to work within a movie clip when the code is at the root?

 

for (var i:int = 0; i < 3; i++) {
this["icon_mc"+i].addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
}

function mouseUpHandler(event:MouseEvent):void {
myText.text = event.target.name;
}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...