views:

64

answers:

1

I have three movieClips (Columns) and each MovieClip contains diffrent number of child movieclips. I want to drag each child clip to another Columns.

So how can I change the child to another parent in action script 3.0

+4  A: 

I would removeChild from parent (column), add to stage (so its on top and you can drag it over your columns). And on release, determine over which column your mouse is, then simply addChild to that column (remove from stage first).

Antriel
For non-Flex components, you can just call `newParent.addChild` without calling `oldParent.removeChild` - it'll be removed automatically. Flex wouldn't like it though
Amarghosh
Yes that was the correct method i think, because removing from and to will affect my other events. I will check and update you if i found any difficulty. Thanks both of you
coderex
@Amarghosh how can I detect the Column on the movement.The cols_1, cols_2... etc are the columns name. I want to know the current area.
coderex
Set `mouseEnabled = false` for the movie-clip while it is being dragged; Start listening for mouse-up events on each column when dragging starts; inside mouse-up handler, addchild the dragged clip to `this` object; Set the mouseEnabled back to true.
Amarghosh
try using dropTarget property of three columns if these columns are movie-clips.
Muhammad Irfan