Link to home
Start Free TrialLog in
Avatar of cakepizza
cakepizza

asked on

How to change parent/child relationships of existing objects

Is there a way to change relationships of objects in action Script 3.0?
lets say you have 4 object on the screen - Box 1 , Box2, Circle1 and Circle2
Circle 1 is a child of Box1
Circle2 is a child of Box 2
Now I want Circle2 to switch parents, so that is is a child of box1, effectively changing the path I have to take to reference it.  Instead of referencing Circle2 as Box2.Circle2  it is Box1.Circle2.
ASKER CERTIFIED SOLUTION
Avatar of CyanBlue
CyanBlue
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cakepizza
cakepizza

ASKER

Just needed 1 little tweek.

Box1.Circle2=Box1.addChild(Box2.Circle2);

Sweet.