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

grosos de lineas en actionscrip

Estas en el tema de grosos de lineas en actionscrip en el foro de Flash y Actionscript en Foros del Web. Tengo este codigo Cita: // GreyShaman 2002 rad = Math.PI/180; //----------------- _root.generatelightning = function () { angle=random(180); xb=new Array; yb=new Array; nb=new Array; nbranch=random(4)+1; for(n=0;n<=nbranch;n++){ ...
  #1 (permalink)  
Antiguo 15/07/2009, 09:09
Avatar de fanny0  
Fecha de Ingreso: noviembre-2004
Mensajes: 438
Antigüedad: 19 años, 5 meses
Puntos: 1
Pregunta grosos de lineas en actionscrip

Tengo este codigo

Cita:
// GreyShaman 2002
rad = Math.PI/180;
//-----------------
_root.generatelightning = function () {
angle=random(180);
xb=new Array;
yb=new Array;
nb=new Array;
nbranch=random(4)+1;
for(n=0;n<=nbranch;n++){
nb[n]=nb[(n-1)]+random(50)+10;

}
with (_root.lightning) {
clear();
f=0;
scalerate=10;step=0;
x=random(200)+400;
y=random(60)+5;
moveTo(x, y);
f=0;
n=0;
do {
f++;
n++;
if(scalerate>0.1)scalerate-=0.02;
if(scalerate>4) scalerate-=0.05;
if (f>=c) {
c = random(6)+1;
d_angle = random(12)+3;
sign = random(3)-1;
f = 0;
}
angle += sign*d_angle;
if(angle>180){
sign=(-1)*sign;
angle= 180;}
if(angle<0){
sign=(-1)*sign;
angle=0;}
x += 3*Math.cos(angle*rad);
y += 3*Math.sin(angle*rad);
lineStyle(scalerate, 0xffffff);
step++;
if(step==12){
with(_root.llightning) {
step=0;
attachMovie("bgrd","bgr"+n,n);
_root.llightning["bgr"+n]._x=x;
_root.llightning["bgr"+n]._y=y;
_root.llightning["bgr"+n]._yscale=_root.bgrnd["bgr"+n]._xscale=scalerate*12+60;
}
}
lineTo(x, y);
for(i=0;i<5;i++)
if (nb[i]==n){
xb.push(x);
yb.push(y);
}

cmp= y>550 || x>800 || x<0;
if(cmp && nbranch>=1){
x=xb.pop();
y=yb.pop();
moveTo(x, y);
angle=random(180);
nbranch--;
cmp=false;
}
} while (!cmp);

}
};
_root.onEnterFrame=function(){
fr++;
if(fr==1){
_root.createEmptyMovieClip("llightning",2);
_root.createEmptyMovieClip("lightning", 3);
_root.ligtning._visible=false;
_root.lligtning._visible=false;
_root.bgrnd._visible=false;
_root.generatelightning();}
else if(fr==2){
_root.ligtning._visible=true;
_root.lligtning._visible=true;}
else if(fr==4){
_root.bgrnd._visible=true;
lightningcolor= new Color(_root.lightning);
lightningcolor.setRGB(0x0);
_root.createEmptyMovieClip("llightning", 2)}
else if(fr==6){
_root.createEmptyMovieClip("lightning", 3)
_root.bgrnd._visible=false;
}
else if(fr==24){
fr=0;}
}
stop();

que es de este efecto...de rayos....

http://www.flashkit.com/movies/Effec...7063/index.php


yo no se donde tengo está el grosos de los rayos, las lineas para que queden más finitas.....


y también me gustaría saber si se puede con el loadmovie darle las dimensiones al swf que uno llama y no solo la posicion en la que uno quiere que aparezca...


Cita:
clip_mc = this.createEmptyMovieClip("holder10", 100);
clip_mc._x = 0.0;
clip_mc._y = 0.0;
clip_mc.unloadMovie("flash.swf");

gracias!!
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




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