pega esto en un frame y ve lo que hace:
Código:
//hice un movieClip con actionscrip...
createEmptyMovieClip("e",1);
e.beginFill(0x228822,100);
e.lineStyle(0x000000,100);
e.lineTo(40,40);
e.lineTo(-40,40);
e.lineTo(0,0);
e.endFill();
//creamos movimiento suuuuaavee
MovieClip.prototype.smooth=function(){
this.targetx=Stage.width/2;//centramos el movieClip al iniciar
this.friction=10;
this.onEnterFrame=function(){
this.xx=this.targetx-this._x;
this._x+=this.xx/this.friction;
}
}
e.smooth();//aplicamos la funcion prototipo
margen=10;//margen de 10 pixeles para que detecte cuando se mueve
this.onMouseDown=function(){
this.onMouseMove=function(){
if(_xmouse<(e._x-margen)){
e.targetx=_xmouse;
}
if(_xmouse>(e._x+margen)){
e.targetx=_xmouse;
}
}
}
this.onMouseUp=function(){//no hace nada
this.onMouseMove=function(){//nada
}
}
le deje un margen de 10 pixeles para que detecte el movimiento del mouse, no hay boton solo eventos del mouse y un movimiento suave para el movie cuando se dirije a la posicion del mouse