Ciao ragazzi,
ho realizzato uno script che deve intercettare il passaggio del mouse su un'area sensibile e spostare il clip cerchio. Il tutto con un listner sul mouse

codice:
function sposta(fine:Number,clip:MovieClip)
	{
		clip.onEnterFrame = function()
			{
				var diff:Number;
				diff = this._x - fine
				trace(fine)
				if(diff < 0)
					{
						this._x = this._x  + Math.round((fine-this._x) / 10)
					}
					else
					{
						this._x = this._x  - Math.round((this._x-fine) / 10)
					}
				trace(this._x);	
				if(this._x < 50)
					{
						this._x = 50
						delete this.onEnterFrame;
					}
				if(this._x > 450)
					{
						this._x = 450
						delete this.onEnterFrame;
					}	
			}
	}
var mioList:Object = new Object;
mioList.onMouseMove = function()
	{
		var a  = _level0.area.hitTest(_xmouse, _ymouse, true);
		trace(a);
		xpos = _xmouse;
		if(a)
			{
				sposta(xpos,cerchio);
delete this.cerchio.onEnterFrame;

			}
			}
Mouse.addListener(mioList);
il codice funziona solo che più passa il tempo più diventa lento. Penso che il problema sia l'evento enterFrame del clip cerchio che non si arresta quando dovrebbe. Consigli?