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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

drag'n'drop with multiple dropzones, Please Help!!!

Status
Not open for further replies.

neildavey

Vendor
Nov 19, 2003
3
GB
Im tryin to do a thing for a kids game where you have six dropzones and 12 dragable items. Im wanting to know how to drop the dragables onto any dropzone

heres the code I have on my dragables

onClipEvent (load) {
origx = this._x;
origy = this._y;
}
onClipEvent (mouseDown) {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
this.startdrag();
}
}
onClipEvent (mouseUp) {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
this.stopDrag();
if (_parent.dropzone1.hitTest(this._x, this._y, true)) {
this._x = _parent.dropzone1._x;
this._y = _parent.dropzone1._y;
}
}
}

I would be really greatfull if someone could help cuz im running out of time on this one! wasted loadsa time tryin to sort it!
Thanks
Neil.
 
...Im wanting to know how to drop the dragables onto any dropzone...

What happens then?

Regards,

cubalibre2.gif
 
.....it then gets a score from the item that is dragged, and stops dragging when dropped.
does this make sense??
I would much apreciate the help!
 
v quick...with dropzone instance names in an array

piece.onRelease = function() {
stopDrag();
for(var i = 0; i < dropzones.length-1; i++){
here = dropzones
if(here.hitTest(_xmouse, _ymouse,true))score++
}
}
 
hi Bill,
having problems, can I email the .fla to you??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top