mudskipper
03-20-2005, 10:31 AM
Hi all,
I have made a 9-piece jigsaw puzzle. When a click on a puzzle piece (movie clip) and try to rotate it using the space bar another piece will rotate instead. Here is the AS for 'piece4'.
on(press){
startDrag(this);
this.swapDepths(100);
}
on(keyPress "<Space>"){
this._rotation +=90;
}
on (release){
stopDrag();
if
(this._droptarget=="/target4")
{
setProperty(this,_x,332.1);
setProperty(this,_y,200.9);
}else{
setProperty(this,_x,68.0);
setProperty(this,_y,107.5);
}
}
I understand that I need to specify that 'piece4' is the one that must rotate but don't know where (presume line 6) and what code, to insert to make each piece rotate when selected. I have tried numerous combinations but am not making any progress.
Thanks
I have made a 9-piece jigsaw puzzle. When a click on a puzzle piece (movie clip) and try to rotate it using the space bar another piece will rotate instead. Here is the AS for 'piece4'.
on(press){
startDrag(this);
this.swapDepths(100);
}
on(keyPress "<Space>"){
this._rotation +=90;
}
on (release){
stopDrag();
if
(this._droptarget=="/target4")
{
setProperty(this,_x,332.1);
setProperty(this,_y,200.9);
}else{
setProperty(this,_x,68.0);
setProperty(this,_y,107.5);
}
}
I understand that I need to specify that 'piece4' is the one that must rotate but don't know where (presume line 6) and what code, to insert to make each piece rotate when selected. I have tried numerous combinations but am not making any progress.
Thanks