Tu lo quieres es esto y es tambien a lo que se refiere ICEM4N:
Por ahora no tengo flash, asi que espero no tener error de sintaxis.
Copia y pega en una pelicula:
Código :
createEmptyMovieClip("micuadro", 1);
function cuadrado(mc, x, y, ancho, alto) {
with (mc) {
clear();
lineStyle(1, 0x000000, 100);
beginFill(0x0099DD, 100);
moveTo(x, y);
lineTo(x+ancho, y);
lineTo(x+ancho, y+alto);
lineTo(x, y+alto);
lineTo(x, y);
}
}
cuadrado(micuadro, 0, 0, 100, 50);
micuadro.onRollOver = function() {
this._parent.cuadrado(this, 0, 0, 400, 200);
};
micuadro.onRollOut = function() {
this._parent.cuadrado(this, 0, 0, 200, 100);
this._x = 0;
this._y = 0;
};
micuadro.onPress = function() {
this.rad = 0;
this.onEnterFrame = function() {
this.rad += 5;
this._x += 50*Math.sin(this.rad);
};
};
micuadro.onRelease = function() {
delete this.onEnterFrame;
};
Basicamente observa:
function cuadrado(mc, x, y, ancho, alto) {
with (mc) {
clear();
lineStyle(1, 0x000000, 100);
beginFill(0x0099DD, 100);
moveTo(x, y);
lineTo(x+ancho, y);
lineTo(x+ancho, y+alto);
lineTo(x, y+alto);
lineTo(x, y);
}
}
PAra que no se deforma la linea, tengo que estar redibujando el cuadrado.
Saludos