-
Senior Member
All you need to do is find out which target the apple was on:
if (this.hitTest(_root["target"+j]))
and use that value of j to set that particular element of the array back to false(which allows the apple (or another one) to be put back there):
taken[j] = false;
Just that inside a simple do loop which increments j each time:
do {
j++;
....
} while(j<16)
-
FK's Official War Driver
Where would I put the do loop?
-
Senior Member
-
FK's Official War Driver
Hmm, just went to lunch, came back...I am now Lost. I think I am just gonna give up on this part of the script. Thanks for all the help guys.
-
Senior Member
Ah, jeez louise, this should be your onPress:
Code:
ref.onPress = function() {
startDrag(this, false, 0, 0, Stage.width, Stage.height);
j=0;
checkVal = false;
do {
j++;
if (this.hitTest(_root["target"+j])) {
taken[j] = false;
checkVal = true;
}
}while(j < 16 && !checkVal)
};
Ok?
-
FK's Official War Driver
Look, its still not working for me. Those damn apples are always able to be in the same targets.
-
Senior Member
http://www.chistyler.com/final2.fla
At my end you can't drag two apples onto the same target
-
FK's Official War Driver
Your FLA is as far as I have gotten before. Sometimes after dragging out of a previously placed apple, it puts the apple at 0x 0y references. Sometimes, it even lets 2 apples inside after one has left.
Like I said, this is seriously very complicating. You are obviously more skilled in this topic than me, and yet your FLA is as far as I have got. I am just going to abandon this part of the work.
-
Senior Member
My apologies, I hadn't tested it extensively enough
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|