View Full Version : way to control layers of generated code? Z-index?
11-20-2009, 01:05 AM
I have a nice snow generating script I downloaded in as3, I am a little new to as3 so I have a question - I have an mc object on the page with the name of "book" there is also an mc object called snow on the page - problem is I can't get the book to be over top of the snow - the snow plays over top of the book. I am sure I need to position it with code but now sure how to go about it. Any suggestions?
11-20-2009, 01:59 AM
Try: addChild(book); This puts it to the top of the display list.
11-20-2009, 02:05 AM
I tried that but the snow is still behind that book object. I am trying to research how to set the depth but not being successful.
11-20-2009, 02:14 AM
I meant to say the snow is still in front of the book - I am trying to figure out how to control it's depth to bring it to the top.
11-20-2009, 02:15 AM
I thought you wanted the book on top of the snow. If you want it under then try: addChildAt(book,0); This'll put it at the bottom of the display list. The second parameter is the display list depth. Play with it and see what you get.
11-20-2009, 02:18 AM
ahhh this worked: parent.addChild(book);
You got me on the right track - thanks!
vBulletin® v3.8.5, Copyright ©2000-2014, Jelsoft Enterprises Ltd.