Drag n drop

hi, need help here.

here is the fla file. it can drag into the green box. i want to count how many grey box already have in the green box. i can drag the grey box into the green box n the code i write is just for count how many time the grey box had click it doesnt use. i want it can count how many grey box already drag into the green box.

who know pls reply me .

i can’t see the fla here:)
but try to use the x and y coodinates to find how many grey boxes in the green box.
example: if a grey box’ _x value, between 100 and 200, it returns true for a variable.

this solution can be improve;)

the fla file cant upload , error here. but it is like i have 1 big box n 4 small box. i want to drag the small box to the big box.

i put code which can drag n count time it click, but if i put all this code in the small box it just can count until 1 for me cos i just click once for each small box. i want it can count how many small box i put in the big box. do u think can i put on(release) to big box n copy the small box code to the big box , will this count for me ??

later will have go btn for user to click n will acoording the count n telltarget to which movieclip.

i dunno how to try ur’s idea which with x y coordinate.

are you using startDrag or - just cilck than copy to the big box?

if the big box’s x values are between 100 and 200 , your code on the small box should be like this,

on(release){
if(this._x>100 && this._x<200){
_root.count++
}
}

i have 4 small box so izzit i have to put the code on each of them ??
this is wat i put on each small box’s code

 
on (press) {
startDrag(this, true);
}
on (release) {
stopDrag();
if (this._droptarget == "/green_box2") {
_root.green_box.gotoAndStop(2);
}
}

try to use this code:


_root.onMouseUp = function() {
	for (i=1; i<5; i++) {
		if (_root["drag"+i].hitTest(green_box)) {
			trace("grey box "+i+" in the box");
		}
	}
};