
31/01/2007, 20:42
|
| | Fecha de Ingreso: enero-2007 Ubicación: vigo
Mensajes: 30
Antigüedad: 18 años Puntos: 0 | |
Re: Como realizar un efecto slide en las acciones de fotograma, añades:
function slide(){
return {xTarget:Math.random()*400, yTarget:Math.random()*400}
}
this.onEnterFrame = function(){
if(!p) p=slide()
disX = this._x-p.xTarget
disY = this._y-p.yTarget
this._x = this._x-disX/8
this._y = this._y-disY/8
if(Math.abs(disX)<1 && Math.abs(disY)<1) p=slide()
} |