quindi cosi...
codice:onClipEvent (load){ z=false } onClipEvent (enterFrame){ if (_x - _width / 2 < _root.area._x - _root.area._width / 2) { _x = _root.area._x - _root.area._width / 2 + _width / 2; } if (_y - _height / 2 < _root.area._y - _root.area._height / 2) { _y = _root.area._y - _root.area._height / 2 + _height / 2; } if (_x + _width / 2 > _root.area._x + _root.area._width / 2) { _x = _root.area._x + _root.area._width / 2 - _width / 2; } if (_y + _height / 2 > _root.area._y + _root.area._height / 2) { _y = _root.area._y + _root.area._height / 2 - _height / 2; } if (z==true){ startDrag(this) } } onClipEvent (mouseDown){ if (this.hitTest(_root._xmouse,_root._ymouse,true)){ z=true }} onClipEvent (mouseUp){ stopDrag() z=false }


Rispondi quotando