
Welcome Guest
|
#1
|
|||
|
|||
|
Hi,
I've created a drag and drop flash movie in which my draggable item can be dragged to a drop area. If this area isn't hit then my item snaps back to it original position. This is my first time doing this and great it works but it only allow each item to have one drop zone. I want to create a move so that it has say 10 items and 10 drop zones. Each item can then be dropped in to any of the 10 drop zone. I've include the code I have used for each draggable item the only difference is the x y coordinates will be different on each item and the drop zone is different. Ideally I would just be a case of adding multiple drop zones in my code but I'm unsure. Hopefully someone can help. Actionscript:
on (press) {
startDrag("");
this.swapDepths(999);
myx = 641;
myy = 352;
_root.hint.gotoAndStop(1);
}
on (release, releaseOutside) {
stopDrag();
// This should collide with the Bangalore hit area
if (this.hitTest("_root.Sub1_Hit") == false) {
//no collision
this._alpha = 100;
this._x = myx;
this._y = myy;
this._xscale = 100;
this._yscale = 100;
//_root.correct1.removeMovieClip();
_root.correct1._alpha=0;
} else {
//yes collision occurred
this._x = -5;
this._y = 778;
this._xscale = 100;
this._yscale = 100;
music = new Sound();
music.attachSound("belll");
music.start(0,0);
_root.correct1._alpha=100;
}
}Cheers Scott Last edited by [PAUL FERRIE] : 05-17-2007 at 09:56 PM |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| drag and drop into a box in any order | kazooki | Flash 8 |
1 | 03-19-2007 12:11 PM |
| Drag & Drop: Deleting when pulled off main area | GrittyKitty | Newbies |
6 | 12-01-2006 10:42 PM |
| Drag and drop problems | Annet | Flash MX 2004 |
4 | 08-31-2005 12:22 PM |
| Drag & Drop Help! | jmwebcenter | Flash MX 2004 |
1 | 02-08-2004 07:27 PM |
| How to unable Drag and Drop movies. | choi_kathryn | Flash 5 Actionscript |
1 | 11-30-2002 02:14 PM |





