Ver Mensaje Individual
  #2 (permalink)  
Antiguo 31/03/2004, 16:06
Avatar de TMeister
TMeister
Crazy Coder
 
Fecha de Ingreso: enero-2002
Ubicación: En la Oficina
Mensajes: 2.880
Antigüedad: 22 años, 3 meses
Puntos: 193
A ver si esto te sirve,.....
Copia/Pega y prueba..
Lo que dibuja la linea es el Prototype dibuja..

Código:
MovieClip.prototype.crea = function(nombre, x, y, ancho, largo, color, prof) {
	tmp_mc = createEmptyMovieClip(nombre, prof);
	tmp_mc._y = y;
	tmp_mc._x = x;
	tmp_mc.lineStyle(1);
	tmp_mc.beginFill(color);
	tmp_mc.moveTo(0, 0);
	tmp_mc.lineTo(0, 0);
	tmp_mc.lineTo(0+ancho, 0);
	tmp_mc.lineTo(0+ancho, 0+largo);
	tmp_mc.lineTo(0, 0+largo);
	tmp_mc.lineTo(0, 0);
};
MovieClip.prototype.dibuja = function(destino) {
	this.startDrag();
	this.onEnterFrame = function() {
		line_mc = createEmptyMovieClip("l", 10);
		line_mc.lineStyle(1, 0x999999);
		line_mc.moveTo(this._x, this._y);
		line_mc.lineTo(this._x, this._y);
		line_mc.lineTo(destino._x, destino._y);
	};
};
MovieClip.prototype.detiene = function() {
	stopDrag();
	delete this.onEnterFrame;
};
/***********************************************
	    Creamos los Objetos a arrastar
***********************************************/
crea("a_mc", 20, 20, 10, 10, 0xFF0000, 1);
crea("b_mc", 120, 120, 10, 10, 0xFF0000, 2);
/***********************************************
	        Asignamos los Eventos
***********************************************/
a_mc.onPress = function() {
	this.dibuja(b_mc);
};
a_mc.onRelease = function() {
	this.detiene();
};
//----------------------------
b_mc.onPress = function() {
	this.dibuja(a_mc);
};
b_mc.onRelease = function() {
	this.detiene();
};
Saludos!!