 |
 |
Flash - attaching multiple movies
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Apr 2005
Location: Mpls, MN
Status:
Offline
|
|
I'm trying to dynamically attach multiple movies onto the stage using actionscript. My problem is that only the last movie I attach actually appears on the stage. Here's my code:
Code:
function addGroupNote(author, message, y) {noteContainer.attachMovie('GroupNote2','groupNote'+y,2);
groupNote = noteContainer['groupNote'+y];
groupNote.author.text = author;
groupNote.message.text = message;
groupNote._x = 0;
groupNote._y = y; }
addGroupNote('jon','asdf',0);
addGroupNote('blaine','blah',165);
Running the above code seems to only attach the last groupNote or perhaps overwrites the first groupNote with the second. Anybody done this sort of thing before or know what's going on?
|

Thus, creating the most ginormous can of whoop ass the world as ever seen.
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status:
Offline
|
|
Code:
noteContainer.attachMovie('GroupNote2','groupNote'+y,2);
You're attaching each movie to the container with exactly the same depth (2). This means each movie will overwrite the last. See if you can either keep track of the level of each movie and pass it to the function, or use the Flash 7 method noteContainer.getNextHighestDepth(); - this will ensure each movie has a unique depth.
|
|
Computer thez nohhh...
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Apr 2005
Location: Mpls, MN
Status:
Offline
|
|
Yeah, I figured that out last night. That getNextHighestDepth() function seems like it will come in handy, thanks man.
|

Thus, creating the most ginormous can of whoop ass the world as ever seen.
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |