Good afternoon folks(well it is here anyway)
My scenario is I’m building a D&D question where there are 6 draggable options and two available empty slots.
I have 2 questions for you nice people.
Firstly, just say i drag ‘option1’ to ‘Target A’ and then do the same with ‘option 2’ …whats the most efficient way to dump ‘option 1’ out of targetA…ie i dont want more than one option being able to reside in a target at any one time.
Secondly, currently i have the options snapping back to their origins if they’re not released on either target…i’d really love to have them slide back to the origin position instead of snapping. I’ve seen this done in an .fla that i found on flashkit I think but its beyond me.(i’ll attach it anyway)
anyway the code currently on my options is this:
on (press) {
startDrag("", false, 20, 500, 550, 725);
}
on (release) {
stopDrag();
if (this._droptarget == “/targetA”) {
setProperty(this, _x, 412);
setProperty(this, _y, 505);
} else if (this._droptarget == “/targetB”) {
setProperty(this, _x, 145);
setProperty(this, _y, 520);
} else {
setProperty(this, _x, 30);
setProperty(this, _y, 560);
}
}
Thanks for reading.