-
Accessing clips created with attachMovie
Hi,
I have a question as to how I would go about accessing the movie clips I'm creating with the following code:
PHP Code:
for (i=0; i<total; i++) {
_root.attachMovie("thumbButton", "thumb" + i, i);
}
This creates movie clips labeled "thumb1", "thumb2", etc. How would I go about accessing these movie clips?
IE: In the same for loop I want to call .loadMovie from each of them.
thumb1.loadMovie("images/1_gallery_1_thumb.jpg");
How do I dynamically get the 1 in there?
-
Senior Member
Code:
for (i=0; i<total; i++) {
BOB=_root.attachMovie("thumbButton", "thumb" + i, i);
//now you can identify it as "BOB"
BOB.onEnterFrame....
}
-
See-n-reMember
'iterate' the reference
you can 'iterate' the object reference like this:
Code:
for (i=0; i<total; i++) {
_root.attachMovie("thumbButton", "thumb" + i, i);
_root["thumb" + i].loadMovie(" url ", level / target [ , variables ]) ;
}
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
|