Bueno ya encontre el codigo AS, le he estado mirando, y no comprendo como selecciona las piezas del puzzle para arrastrarlas y girarlas;
en concreto ¿donde se carga el valor de la variable "whichpiece". el codigo es este :
// ----------
// INITIALIZE
// ----------
// ENTER code here
_root.pattern._visible = false;
_root.edges._visible = false;
_root.image._visible = false;
_root.piecenumbers._visible = false;
_root.scramblebutton._visible = false;
_root.areyousure._visible = false;
_root.congrats._visible = false;
dialog = true;
// ---------
// FUNCTIONS
// ---------
// scrambles the puzzle pieces
function Scramble() {
// enter trace action here
for (var i = 1; i<=49; i++) {
with (this["piece"+i]) {
_x = Math.floor(Math.random()*400)+360;
_y = Math.floor(Math.random()*480)+40;
_rotation = Math.floor(Math.random()*4)*90;
}
}
}
//
// rotates, displays, or drags a piece
// depending on the key pressed
//
// ENTER RotateDisplayOrDrag() function here
function RotateDisplayOrDrag(whichPiece) {
if (Key.isDown(1
) {
_root[whichPiece]._rotation += 90;
} else if (Key.isDown(Key.SHIFT)) {
pieceNumber = whichPiece.slice(5);
} else {
startDrag(_root[whichPiece], false, 20, 20, 780, 580);
}
}
//
// snaps pieces into the solution grid
function Snap(whichPiece) {
if (whichPiece._x>40 && whichPiece._x<320 && whichPiece._y>40 && whichPiece._y<320) {
var xSnapNumber = Math.floor((whichPiece._x-20)/40);
var ySnapNumber = Math.floor((whichPiece._y-20)/40);
if (((whichPiece._x-20)%40)/40<.5) {
whichPiece._x = xSnapNumber*40+20;
} else {
whichPiece._x = (xSnapNumber+1)*40+20;
}
if (((whichPiece._y-20)%40)/40<.5) {
whichPiece._y = ySnapNumber*40+20;
} else {
whichPiece._y = (ySnapNumber+1)*40+20;
}
}
}
// checks if all the pieces are in their correct positions
function IsItDone() {
var columns = 7;
for (var i = 1; i<=49; i++) {
var row = Math.ceil(i/columns);
var column = i-((row-1)*columns);
with (this["piece"+i]) {
if (_x != column*40+20 || _y != row*40+20 || _rotation != 0) {
break;
}
}
}
if (i == 50) {
congrats._visible = true;
dialog = true;
}
}
// clear piece number text field when the movie starts
pieceNumber = "";
¿alguien me puede ayudar?