I haven't been able to find a definitive, helpful answer about this...
I'm loading several MC's dynamically using attachMovie. Now, these things are dynamically named, but I want to get the onRelease event of them. Here's what I have so far.
function importClips(movieClipArray)
{
xPos = 400;
for (i = 0; i < movieClipArray.length; i++)
{
linkName = movieClipArray[ i ];
newName = linkName;
_root._level1.attachMovie(linkName, newName, i);
newMovie = eval("_root._level1." + newName);
newMovie._x = xPos;
newMovie._y = 155;
xPos += newMovie._width + 15;
newMovie.onRelease = function()
{
selectShell(newName); // Does a few other things with the clip.
}
}
}
Since I can't discretely reference the MC's, I have to put the onRelease inside of the function (and loop) that attaches them.
Invariably, when I click on any of the MC's, the last MC loaded gets the "selectShell()" function call.
Any ideas on how I can get around this?
I'm loading several MC's dynamically using attachMovie. Now, these things are dynamically named, but I want to get the onRelease event of them. Here's what I have so far.
function importClips(movieClipArray)
{
xPos = 400;
for (i = 0; i < movieClipArray.length; i++)
{
linkName = movieClipArray[ i ];
newName = linkName;
_root._level1.attachMovie(linkName, newName, i);
newMovie = eval("_root._level1." + newName);
newMovie._x = xPos;
newMovie._y = 155;
xPos += newMovie._width + 15;
newMovie.onRelease = function()
{
selectShell(newName); // Does a few other things with the clip.
}
}
}
Since I can't discretely reference the MC's, I have to put the onRelease inside of the function (and loop) that attaches them.
Invariably, when I click on any of the MC's, the last MC loaded gets the "selectShell()" function call.
Any ideas on how I can get around this?