Ver Mensaje Individual
  #2 (permalink)  
Antiguo 14/02/2007, 19:31
Rizzo
 
Fecha de Ingreso: septiembre-2006
Mensajes: 1.193
Antigüedad: 17 años, 7 meses
Puntos: 30
Re: como utilizar startDrag????

eso se puede hacer sin stardrag
[CODE]
  • coloca un movieclip en el escenario y como nombre de instancia ponle mc
  • crea una capa y pones este codigo:

Código:
mover = function () {
	this.onEnterFrame = function() {
		_root.mc._x -= (_root.mc._x-(_root._xmouse))*0.3;
		_root.mc._y -= (_root.mc._y-(_root._ymouse))*0.3;
	};
};
this.onMouseMove = function() {
	if (mc.hitTest(_root._xmouse, _root._ymouse)) {
		mover();
	}
};



y si quieres que si sale del mc ya no lo siga entonces pones este:

nota:mueve el puntero como loco hasta que se salga del area:


Código:
mover = function () {
	this.onEnterFrame = function() {
		_root.mc._x -= (_root.mc._x-(_root._xmouse))*0.3;
		_root.mc._y -= (_root.mc._y-(_root._ymouse))*0.3;
	};
};
this.onMouseMove = function() {
	if (mc.hitTest(_root._xmouse, _root._ymouse)) {
		mover();
	} else {
		delete this.onEnterFrame;
	}
};