ciao ho questo script praticamente mi muove l'immagine a destra e a sinistra in base al movimento del mouse e funziona tutto bene.. il problema è questo se mi fermo con il mouse in un punto preciso dello stage l'oggetto continua a muoversi (come se ingrorasse i parametri che gli ho dato) fino a sparire completamente dallo stage.. avete qualche idea?


Codice:
Codice PHP:
larghezzas 800
ghiri_mc
._x larghezzas/2
maxxghiris 
ghiri_mc._x 20
maxxghirid 
ghiri_mc._x 20
puntocentrale 
150
speed 
50;
movieh larghezzas
    trace
(maxxghirid)
    
var 
mouseListener:Object = new Object (); 
mouseListener.onMouseMove = function () { 

if ((
_root._xmouse >= larghezzas/2+puntocentrale) || (_root._xmouse <= larghezzas/-puntocentrale)) { 
            
            
// MUOVE GHIRI A SX CON IL MOUSE A DX
            
if (_root._xmouse >= larghezzas/2+puntocentrale) {
                
                 
ghiri_mc.onEnterFrame = function () { 
                    if (
this._x  maxxghirid) { 
                        
delete this.onEnterFrame
                    } else {
                        
                        
xpos _root._xmouse;
                        
xpos xpos-(movieh/2);
                        
this._x this._x+(xpos/speed);
                        
                    }
                }
                }
    
                if (
_xmouse <= larghezzas/2-puntocentrale ) {
                 
ghiri_mc.onEnterFrame = function () { 
                    if (
this._x  maxxghiris) { 
                        
delete this.onEnterFrame
                    } else {
                        
xpos2 _root._xmouse;
                        
xpos2 xpos2-(movieh/2);
                        
this._x this._x+(xpos2/speed);
                    }
                 
                }
                }
                
            

                
                } else {
                    
// Non fa niente in caso il mouse rusulti fuori area
                    //trace("none")
                    
                
}


    
}; 
Mouse.addListener (mouseListener);