Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Flash - attaching multiple movies

Flash - attaching multiple movies
Thread Tools
Fresh-Faced Recruit
Join Date: Apr 2005
Location: Mpls, MN
Status: Offline
Reply With Quote
Nov 19, 2005, 04:04 PM
 
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
Reply With Quote
Nov 19, 2005, 06:03 PM
 
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...
     
MacAtak  (op)
Fresh-Faced Recruit
Join Date: Apr 2005
Location: Mpls, MN
Status: Offline
Reply With Quote
Nov 20, 2005, 12:43 PM
 
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.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 07:43 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2