This content has been marked as final. Show 7 replies
Put the circle and square sprites as one custom component.
Add your custom component to your single container. When you code your drag statements, code it to drag the custom component, not the sprites within the component. Doing it this way will keep your sprites together.
"Put the circle and square sprites as one custom component.
Add your custom component to your single container."
can you demo this with a bit of code please?
I'll work on it a bit this afternoon. It probably works better on paper than actually doing it, so I'll play with it and see what happens.
Can you post your code for one of the movable sprites? I could be way off on what I think you are talking about.
FYI, the parenting rules:
Navigator children must be containers
Container children must be IUIComponents
UIComponent children can be anything (eg sprite).
here is the code I have currently
addChild( ref );
is adding ref to the current component("this" implied.) You don't want that, do you? You want to add them to ref_new.
Also, be sure all components have an explicit size, and be sure their x, y aren't out of the bounds of their parent.
Thanks I did try that, however.
When I move the main sprite, the others remain at their original location and do not move to the location of the main sprite.
I assumed that because those other two sprites were children that they would follow whatever location their parent had. Is this mistaken?