MX: Simple(?) loadMovie & onRollOver problem; Array question

Hello fellow flashers and flasher…ettes?

Well- seeing how small my problem seems to be this time, I hope none of you will take offense in my… fellowship. Having trouble with something this simple might disqualify me from being ranked among some of the experts on here :smiley:

But I’m trailing off- here’s the problem:

I have a loop that goes through an array and duplicates (and positions) movieclips on the scene and loads JPGs into them with “loadMovie”.

I then try to attach an “onRollOver”-handler to the movieclip but it doesn’t respond. Here’s the thing: It works fine when I don’t load the images into the MC instances… but as soon as I do, the onRollOver is not responsive anymore.

I read the telltale line “loading a JPG or SWF into a movieclip replaces it”… is that the cause of the problem? I mean- can I not refer to the duplicated MCs anymore as soon as I load something into them? How could I work around it?

Here’s the code:[AS]for (var var_land in arr_flags) {
FlagContainer.duplicateMovieClip(var_land,_root.getNextHighestDepth());
_root[var_land]._x = var_land*60;
_root[var_land].myID = var_land;
_root[var_land].loadMovie(arr_flags[var_land][0]);
_root[var_land].onRollOver = function() {
flagZoomIn(this.myID);
}
_root[var_land].onRollOut = function() {
flagZoomOut(this.myID);
}
_root[var_land].onRelease = function() {
trace(arr_flags[this.myID][1]);
}
}[/AS](“arr_flags[this.myID][0]” holds the filename, “arr_flags[this.myID][1]” an additional info for displaying purposes).

The whole code works like a charm if I remove the line “_root[var_land].loadMovie(arr_flags[var_land][0], _root[var_land]);”, but of course that kind of defies it’s purpose.

Do I have to refer to the MC differently once it has the JPG loaded into it? I checked the Debug info on the existing Objects and they are always the same, whether I use the “loadMovie”-line in my code or not.

Your help is very appreciated :slight_smile: