PDA

View Full Version : Drag & Drop from Scroll Pane Component to another location


xoof
06-02-2005, 12:00 PM
I have read other posts concerning similar matters but they have'nt really helped me.

My situation is:

I have a scoll pane component inside of which are movieClips which can be dragged around.

I need them to be draggable outside the component to another level (_root for example). At present they only move within the confines of the scroll pane.

If possible i want to aviod having to attach a new instance to the _root and remove the original from the scroll pane as the movieClips are all dynamically generated and have lots of functionallity assigned to them when they are created.

So i am asking: Is there a way of moving a movieClip instance from the scroll pane to the _root without having to attach a new instance and start assign all the functionailty from scratch?

If not, what is the best way of approaching this task?

Thanks in advance.

sleekdigital
06-02-2005, 06:58 PM
You are going to have to use attach or duplicate. If you use a movieclip subclass, then your new instance will have all the same properties and methods as the instance in the scroll pane ... Unless you change things on that instance at runtime, in which case you could create a static method that makes creates a copy. Have the method take take an instance as an argument, and then have it create a new instance and copy properties from the original instance.

xoof
06-02-2005, 08:02 PM
Got ya, will give it a go! Thanks!