I’m making a jigsaw puzzle and the pieces get mixed up at first, and therefore have new initial x,y coordinates.
How could I randomly mix the pieces on the board, and then capture the x,y coordinate of that random position to plug in to my code below?
Below is the code in the drag n drop function that either snaps the piece to the correct position or snaps the piece back to its original position (if it’s not placed in the correct drop target):
{
if (this._droptarget == "/something") {
this._x = _root.something._x;
this._y = _root.something._y;
}
else{
this._x = 440;
this._y = 320;
}
}
The x=440 and y=320 would be randomly generated in the beginning and then plugged into this statement.
-
How do I randomly mix the objects on stage up?
-
How do I capture their randomly generated x,y coordinates and place it into the code above?
Thanks.