Hello !!
Ok, I have a question pertaining to “drag and drop”. ANy help would be very much appreciated.
Ideally what should happen?
There are two red circles, and one item. he users should drag these circles onto the item. The user will try to drop in random order items (red_circle_1, and red_circle_2) on “item_1”
Whichever red circle the user tries to drop FIRST, that will be positioned in the column A. And if the column A is already occupied by one red circle, when the user tries to drag the remaining red circle (whichever this may be) then the other circle (it could be either red circle 1 or 2) would automatically go to the second column.
What doesn’t happen?
The first circle, which the user drags first goes to the “column B” instead of column A. And the second red circle on dragging goes to column “A”. It should happen just the other way.
What have I done so far?
I created target 2 red circles (red_1, red_2), and one destination item (item_1)
Within the destination item, I have the following script:
on (rollOver) {
if((_root.red_1._droptarget eq “/item_1”) || (_root.red_2._droptarget eq “/item_2”))
var item_1_score;
_root.item_1_score +=1;
}
This, I thought this would keep a counter. The intent is, if the score is more than “1” the user will have the red circledirected to column 2, and viceversa.
Within the red circles, I have the following script:
on (press) {
startDrag ("_root.red_1");
}
on (release) {
stopDrag ();
if(_root.red_1._droptarget eq “/item_1”) {
if (_root.item_1_score == 1){
setProperty ("_root.red_1", _x, 230);
setPropery ("_root.red_1", _y, 141);
}else{
setProperty ("_root.red_1", _x, 362);
setPropery ("_root.red_1", _y, 148);
}
}
}