开发者

Move one child movieClip to another movieClip in Flash Action script 3.0

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 ca开发者_StackOverflow社区n I change the child to another parent in action script 3.0


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).


I have done similar one . But i followed a different plan. First I gave a base class for child objects. In the class there is a public var which will store column name. Set mouseEnabled = false for the column movieclip. And added drag event to the child objects. When drop the child in a column movieclip and i will check hittest. If the child hit any of teh column movieclip i will add the child object to the column movieclip and set the public var value inside the movieclip to the droped movieclips name. So that at last i could figure iut which containts which child object.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜