ciao.. avevo messo tra i preferiti un link con un tutorial che spiegava come muovere un mc a dx o a sx in base al movimento del mouse .. solo che l'ho perso .. ho creato il codice però c'è qualcosa che non va .. avete il link di un tutorial simile oppure un aiutino..
Codice PHP:
var mouseListener:Object = new Object();
mouseListener.onMouseMove = function() {
if (_ymouse < 330 ){
if (_xmouse = _root.larghessas/2){
}
if (_xmouse < _root.larghessas/2) {
// MUOVE MC A SX
body_mc.onEnterFrame = function () {
var ___TWEENmouse:Tween = new Tween(this, "_x", Strong.easeOut, this._x,this._x +15, 15, false);
if (this._x >= _root.larghessas/2) {
delete this.onEnterFrame;
}
};
};
if (_xmouse > _root.larghessas/2) {
// MUOVE MC A DX
body_mc.onEnterFrame = function () {
var ___TWEENmouse2:Tween = new Tween(this, "_x", Strong.easeOut, this._x,this._x - 15, 15, false);
//if ( ((-(this_mc._x)) + this_mc._width) > _root.larghessas/2 ) {
//delete this.onEnterFrame;
//}
};
};
};
if (_ymouse > 330 or _ymouse < 100){
delete body_mc.onEnterFrame;
}
};
Mouse.addListener(mouseListener);
praticamente dovrebbe spostare body_mc nella asse x a dx o sx in base a dove si trova il mouse e più o meno lo fa però non riesco a bloccare l'enterframe quando la fine di body_mc si trova al centro ... :master: