-
1. Re: addChild() display the Movie Clip outside of the parent
dmeN Nov 9, 2011 7:58 AM (in response to joeln3)Not quite sure what you mean. If you mean you want to restrict the edges of the added child to stay inside the parent, then you'll want to use a mask. If that's not the problem, please explain better.
-
2. Re: addChild() display the Movie Clip outside of the parent
Ned Murphy Nov 9, 2011 8:01 AM (in response to joeln3)What are the x/y coordinates the second mc before you add it? You might need to adjust them.
-
3. Re: addChild() display the Movie Clip outside of the parent
Chipleh Nov 9, 2011 8:05 AM (in response to joeln3)You can use setChildIndex to stack added children on top of each other:
mc1.setChildIndex(mc2, (mc1.numChildren - 1));
However, the line of code above would set your mc2 above the mc1, where I believe you're looking for the opposite effect?
Or, are you looking to change the x and y position of your child to bring it inside the bounds of the mc1?
-
4. Re: addChild() display the Movie Clip outside of the parent
highlightscript Nov 9, 2011 8:52 PM (in response to joeln3)you can use a mask for this
-
5. Re: addChild() display the Movie Clip outside of the parent
joeln3 Nov 9, 2011 11:12 PM (in response to dmeN)Hello dmennenoh,
Yes I want to restrict the edges of the child. But I thought there was another option than using a mask (because in my mind if I add a child to a DisplayObject then the child cannot be displayed outside the parent object).
But maybe I was wrong...
Thanks,
-
6. Re: addChild() display the Movie Clip outside of the parent
Ned Murphy Nov 10, 2011 4:24 AM (in response to joeln3)If you add a child to a display object, it becomes a part of that display object, thus defining the boundaries of the parent as much as anything else contained within the parent... it doesn't conform to the exisiting boundaries, it adds to them.




