View Full Version : setChildIndex and addChild Problems
aella_27
January 11th, 2010, 03:55 PM
Ok, I'm creating a webpage in Flash CS4. The page consists of 9 squares and when you rollover them they disappear to show information. The squares are all movie clips and they play a slideshow. My main information is located on a layer under the movie clips layer, but in one of the information squares I have a link that will not work (I know this is because my movie clip is still there, just at %0 opacity). So I was thinking I could use the setChildIndex or addChild to send the front movie clip behind the information, but I'm not sure how I would go about coding it?
I hope this makes sense and any help is greatly appreciated
Thanks
francis b
January 11th, 2010, 05:07 PM
If there are only two movieclips whose positions you would like to switch, I would suggest using the swapChildren() method, which switches the index positions of the two clips.
To use it, you have to feed it two parameters, which are the two display objects.
So if I want to switch two movieclips called "MC1" and "MC2" that exist in a container movieclip called "container:, I call the method like so:
container.swapChildren(MC1, MC2);
-fran
http://francisbaptiste.com
aella_27
January 12th, 2010, 09:46 AM
If there are only two movieclips whose positions you would like to switch, I would suggest using the swapChildren() method, which switches the index positions of the two clips.
To use it, you have to feed it two parameters, which are the two display objects.
So if I want to switch two movieclips called "MC1" and "MC2" that exist in a container movieclip called "container:, I call the method like so:
container.swapChildren(MC1, MC2);
-fran
http://francisbaptiste.com
Ok I get how that would work, but how would I code it so that it switches the index position on mouse over?
Thanks
cheyennemtnman
January 13th, 2010, 12:44 AM
Ok I get how that would work, but how would I code it so that it switches the index position on mouse over?
Thanks
I am also interested in this... I have five elipses that are buttons and I expand the elipses to reveal the smaller text on a Mouse over... the problem I am having is that they overlap and the other buttons cover some of the expanded text of the expanded elipse.. can I use setChildindex for each button to be at the top of the item list in each of its states?
Is so how would I do this?
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.