Foros del Web » Creando para Internet » Flash y Actionscript »

Problemonnnnnnn!! con lineas

Estas en el tema de Problemonnnnnnn!! con lineas en el foro de Flash y Actionscript en Foros del Web. por favor ayudenme.... function Link(from, to, value, url, bw) { this.from = nodes[from]; this.to = nodes[to]; this.value = parseFloat(value); this.bw = parseInt(bw); linkName = linkName+"a"; ...
  #1 (permalink)  
Antiguo 30/01/2004, 12:23
 
Fecha de Ingreso: abril-2003
Ubicación: Chile
Mensajes: 59
Antigüedad: 21 años
Puntos: 0
Problemonnnnnnn!! con lineas

por favor ayudenme....

function Link(from, to, value, url, bw) {
this.from = nodes[from];
this.to = nodes[to];
this.value = parseFloat(value);
this.bw = parseInt(bw);

linkName = linkName+"a";
_root.createEmptyMovieClip(linkName, linkDepth++);
this.clip = _root[linkName];
this.clip.parent = this;
Mouse.addListener(this.clip);
lineStyle(1, 0x000000);
with ( linkName )
{
this.clip.onEnterFrame = function(){
moveTo(getProperty(to + "_txt",_x)+(getProperty(to + "_txt", _width)/2), getProperty(to + "_txt",_y)+20);
lineTo(getProperty(from + "_txt",_x)+(getProperty(from + "_txt", _width)/2) , getProperty(from + "_txt",_y)+20);
};
}
}


tengo dos circulos... y esta linea va de uno a otro... pero cuando intento mover un circulo... se me duplica la linea.. osea me keda la primera ke se hizo... y una segunda (o tercera cuarta...etc segun la cantidad de movimientos), como lo hago para ke no lo haga... aparte se pone muy lenta la animacion de mover...

por favorrrrrrrr... ayudenmeeeeee!!! :-p

HELPPPPPPPP!!

Desesperado....
__________________
Rodrigo A. Morales G.
Desarrollador Web
  #2 (permalink)  
Antiguo 30/01/2004, 13:30
Avatar de ¬...  
Fecha de Ingreso: noviembre-2003
Ubicación: Guatemala
Mensajes: 742
Antigüedad: 20 años, 5 meses
Puntos: 4
a ver si es esto lo que necesitas:
abri un nuevo .fla y pega esto en el frame1
Código:
atachar_circulos=function(cuantos){
	limite_real=cuantos+1;
	createEmptyMovieClip("cholder",100);
	for(i=1;i<limite_real;i++){
		cholder.attachMovie( "circulolibreria", "circulo"+i,100+i);
		if(i==limite_real-1){
			trace(i+" circulos creados");
		}
	}
	
}
crear_lineas=function(numerol){
	rnlimite=numerol+1;
	for(ln=0;ln<rnlimite;ln++){
createEmptyMovieClip("linea"+ln,200+ln);
	}
linea1.lineStyle(0,0x000000,100);
linea1.lineTo(100,100);
linea2.lineStyle(0,0x000000,100);
linea2.lineTo(100,100);
linea3.lineStyle(0,0x000000,100);
linea3.lineTo(100,100);
linea4.lineStyle(0,0x000000,100);
linea4.lineTo(100,100);
linea5.lineStyle(0,0x000000,100);
linea5.lineTo(100,100);
linea6.lineStyle(0,0x000000,100);
linea6.lineTo(100,100);
}
atachar_circulos(5);
crear_lineas(4);
this.onEnterFrame=function(){
	c1x=cholder.circulo1._x;
	c1y=cholder.circulo1._y;
	c2x=cholder.circulo2._x;
	c2y=cholder.circulo2._y;
	c3x=cholder.circulo3._x;
	c3y=cholder.circulo3._y;
	c4x=cholder.circulo4._x;
	c4y=cholder.circulo4._y;
	c5x=cholder.circulo5._x;
	c5y=cholder.circulo5._y;
	c6x=cholder.circulo6._x;
	c6y=cholder.circulo6._y;
	c7x=cholder.circulo7._x;
	c7y=cholder.circulo7._y;
	linea1._x=c1x;
	linea1._y=c1y;
	linea1._xscale=c2x-c1x;
	linea1._yscale=c2y-c1y;
	linea2._x=c2x;
	linea2._y=c2y;
	linea2._xscale=c3x-c2x;
	linea2._yscale=c3y-c2y;
	linea3._x=c3x;
	linea3._y=c3y;
	linea3._xscale=c4x-c3x;
	linea3._yscale=c4y-c3y;
	linea4._x=c4x;
	linea4._y=c4y;
	linea4._xscale=c5x-c4x;
	linea4._yscale=c5y-c4y;
	linea5._x=c5x;
	linea5._y=c5y;
	linea5._xscale=c6x-c5x;
	linea5._yscale=c6y-c5y;
	linea6._x=c6x;
	linea6._y=c6y;
	linea6._xscale=c7x-c6x;
	linea6._yscale=c7y-c6y;
}
crea un nuevo movieClip y dentro metele un shape en forma de circulo, alinealo al centro, en las acciones del frame pegale:
Código:
dev=10;
set_position=function(){
	enx=int(Math.random()*600);
	eny=int(Math.random()*enx);
	x=enx;
	y=eny;
}
this.onEnterFrame=function(){
	xx=x-_x;
	yy=y-_y;
	_x+=xx/dev;
	_y+=yy/dev;
}
set_position();
setInterval(set_position,2000);
salite, y desde la libreria dale click derecho y click en el submenu linkage... y click a export for actionscript y click en export in first frame, el nombre del identificador: circulolibreria
probale y mira si es eso lo queres
__________________
'_'

...
  #3 (permalink)  
Antiguo 30/01/2004, 15:06
 
Fecha de Ingreso: abril-2003
Ubicación: Chile
Mensajes: 59
Antigüedad: 21 años
Puntos: 0
muy bueno...

oiga compadre... me salio... me ayudo harto algunas partes de tu codigo... muchas gracias.. aunque sea argentino...jajajajaj son bromas... te pasaste..

chaolin..
__________________
Rodrigo A. Morales G.
Desarrollador Web
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta

SíEste tema le ha gustado a 1 personas




La zona horaria es GMT -6. Ahora son las 18:54.