Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple drag and drop problem

Status
Not open for further replies.

peasepud

Programmer
Jul 20, 2007
35
Hi,

Im totally new to Flash and am trying to get the most simple of drag and drop to work. I have two movie clips on the left hand side in one frame and you can drag each of them over onto the right hand side. The items drag as expected when you click and drag but when you release the button it doesnt release, the item still moves even without the mouse button down. There is no correct place to drop the item so I havent bothered creating a test to see where they are being released, the actionscript I have is:

item1_mc.onPress = function():Void {
this.startDrag(true);
};
item1_mc.onRelease = function():Void {
this.stopDrag();
};
item2_mc.onPress = function():Void {
this.startDrag(true);
};
item2_mc.onRelease = function():Void {
this.stopDrag();
};


Any thoughts? Do I need to create a "dropzone" or am I missing something really silly?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top