-
[F8] MovieClipLoader Problem: Passing a variable to a dynamic clip
Hi folks,
I have a for loop that loops through an array and loads a clip into an empty movie clip.
Works perfect, except for when I try and create a variable for the movieclip i.e. mc.imageName="My Cat"+i;
When I try to access it from within mcListener.onLoadInit {} with target.imageName, it comes back as undefined.
I know I am loading in a clip, and that the loop runs quicker than loadClip(), but it's as if the variable is being ignored completely once the clip has been loaded in. Am I going about this the wrong way?
Any ideas?
Many thanks
Code Snippet:
Code:
var mcListener:Object = new Object();
mcListener.onLoadInit = function(target:MovieClip)
{
target._x = currentx;
currentx += target._width;
target.onRelease=function()
{
trace(target.imageName);
// displays undefined
}
}
var mcloader:MovieClipLoader = new MovieClipLoader();
mcloader.addListener(mcListener);
for(var i=0; i<images.length; i++)
{
mc=_root.createEmptyMovieClip("catimage"+i,i);
mc.imageName="My Cat"+i;
trace(mc.imageName);
// displays My Cat 1 etc
mcloader.loadClip(images[i],mc);
}
}
createThumbs();
He took daddy's umbrella!
-
Sorry, I think I've found a thread covering this.
Thanks.
He took daddy's umbrella!
-
Bmcc*81
could you post that thread?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|