Can I create a variable from _parent mc right after CreateEmptyMovieClip?

I am trying to something like the following:

createEmptyMovieClip(“iconLoad”+ i, .i+100);
[“iconLoad” + i].iconName = IconArray*;
loadMovie(“pIcon.swf”,[“iconLoad” + i]);

In the movie pIcon.swf there is a local variable iconName. I am trying to set this variable from the above code (2nd line).

It doesn’t seem to work.

What can I try?

Ron

What’s up with the [] in [“iconLoad” + i]?? I think it should be this.[“iconLoad” + i]
And the . in the createEmptyMovieClip??

Try this:

mc=createEmptyMovieClip("iconLoad"+ i, i+10);
//mc is a reference to your clip
mc.iconName = IconArray*;
loadMovie("pIcon.swf",mc);

But the problem that could happen is that when you load the swf in mc, it erases mc completely, so you lose your variable. Can’t you put it anywhere else?

pom :cowboy:

I don’t think I can put it some where else, because this code is all contained within an 'for" statement.

Everytime around it creates another movie clip for each item in an array.length.

Then it sets the current clips iconName to the array value at that increment.

Then within each loaded pIcon.swf I want there to be different iconName variable values. These define the icon label and icon image (iconName + “.jpg”).

Thanks for previous help, and any more ides.

Ron

Well you have to put it somewhere else, because I’m fairly certain your variable will be deleted if you do that.

By the way, are you working with F5 or FMX? :pirate: