Okay, I am using some actionscript (2.0, Flash 8) to attach a few movieclipsto the stage and then load an image into each one of them. After that I tell it to do a mouse follow, but it doesn't seem to work (works if I don't load the image into the movie clip, but then that is defeating the point).
Okay, here is my code:
{attach movieclips and load the image}
CODE
var xml = new XML();
xml.ignoreWhite();
xml.onLoad = function() {
var nodes = this.firstChild.childNodes;
totalItems = nodes[1].childNodes.length-1;
for (var i = 1; i<totalItems; i += 2) {
var mc = main_mc.attachMovie("icon", "item_"+i, 100+i);
mc.loadMovie(nodes[1].childNodes[i].attributes.url);
mc.id = i;
mc.onMouseMove = follow_mouse;
}
}
xml.load(xml_path);
xml_path is the path to my xml document that holds the imaegs.
As I said, this part works fine, it loads the images and everything.
Now we get to this part that is making me upset.
I use this AS to get the mouse positiona and (it is supposed to) move the movieclip to its proper coordinates:
CODE
function follow_mouse(){
id = this.id;
mx = _xmouse;
my = _ymouse;
this._x = mx+(this._width*id);
this._y = my+(this._height*id);
}
For some reason it works when I just have the standard movieclip (which consists of a black box place holder), but doesn't when I attach the image.
Anyone know what is causing this?