Skip to main content
Known Participant
November 30, 2013
Question

Drag and drop in as3

  • November 30, 2013
  • 1 reply
  • 689 views

Hi

For my A-level ict this year I have to create a drag and drop system for a clothing company. In my designs I had an idea that I could have three tabs down the left hand side of the screen these could then be clicked on and a menu would appear with draggable items to go on to a mannequin in the middle of the screen. So let's say the user clicked on tops a menu would appear with a selection of tops that can be dragged from the menu onto the mannequin then after selecting a top they can select the trousers tab and a selection of trousers will appear for dragging and dropping. The problem is that my teacher says that it won't work because the top will disappear when any of the other tabs are selected she suggested some kind of nested stage is this possible and if so how?

I am using as3 in flash cs3.

Matthew

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
November 30, 2013

What you can do is create a new instance of the object that is clicked for dragging as a child of the mannequin's movieclip and drag that into place.  That way it is gong to stay when the menues change.  If the object needs to be removed from the menu then just turn it invisible there.

Known Participant
November 30, 2013

Thank you for the quick reply. So what you are saying is that there is a way that I can get it to work by creating another version of the object that is invisible Then becomes visible when you drag it?

Is this correct?

I'm a bit new at this so I apologise for my incompetence.

Ned Murphy
Legend
November 30, 2013

No, what I am saying is that when you click down on the object in the menu, you dynamically create an new instance of that same object and drag that new instance around.  When you create it you add it as a child of whatever object contains the mannequin (which might be the stage itself).

If you need to make it look like there was only one of them to drag/srop, then you can hide the one that you clicked down on to start with since it is in a separate container.