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

**URL:** <https://forum.kirupa.com/t/mx-simple-loadmovie-onrollover-problem-array-question/164063>\
**Category:** Uncategorized\
**Created:** [September 28, 2005, 9:15am UTC](https://forum.kirupa.com/t/mx-simple-loadmovie-onrollover-problem-array-question/164063 "2005-09-28T09:15:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![CEOofAEP](https://avatars.discourse-cdn.com/v4/letter/c/7cd45c/32.png) [@CEOofAEP](https://forum.kirupa.com/u/CEOofAEP)\
**Post date:** [September 28, 2005, 9:15am UTC](https://forum.kirupa.com/t/mx-simple-loadmovie-onrollover-problem-array-question/164063/1 "2005-09-28T09:15:14Z")

</div>

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 😃

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 🙂
