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

Script AS2 Circulo

Estas en el tema de Script AS2 Circulo en el foro de Flash y Actionscript en Foros del Web. hola tengo un problema con un script de as2. El script dibuja un circulo como si fuera dibujado por un compas, el unico problema es ...
  #1 (permalink)  
Antiguo 06/05/2011, 09:34
 
Fecha de Ingreso: mayo-2011
Mensajes: 3
Antigüedad: 13 años
Puntos: 0
Pregunta Script AS2 Circulo

hola
tengo un problema con un script de as2.
El script dibuja un circulo como si fuera dibujado por un compas, el unico problema es que no tiene la velocidad adecuada.
Podrian ayudarme?
El script:
Código:
MovieClip.prototype.drawWedge = function(x, y, startAngle, arc, radius, yRadius) {
   // mc.drawWedge() - by Ric Ewing ([email protected]) - version 1.3 - 6.12.2002
   // Modified under permission (lol) by TheOm3ga
   var x = 251
   var y = 221
   var startAngle = 180
   var radius = 166.3
   var yradius = 166.3
   
   if (arguments.length<5) {
      return;
   }
   this.moveTo(x, y);   
   if (yRadius == undefined) {
      yRadius = radius;
   }
   var segAngle, theta, angle, angleMid, segs, ax, ay, bx, by, cx, cy;
   if (Math.abs(arc)>360) {
      arc = 360;
   }
   segs = Math.ceil(Math.abs(arc)/45);
   segAngle = arc/segs;
   theta = -(segAngle/180)*Math.PI;
   angle = -(startAngle/180)*Math.PI;
   if (segs>0) {
      ax = x+Math.cos(startAngle/180*Math.PI)*radius;
      ay = y+Math.sin(-startAngle/180*Math.PI)*yRadius;
      this.lineTo(ax, ay);
      this.lineStyle(1,0xff0000,100);
      for (var i = 0; i<segs; i++) {
         angle += theta;
         angleMid = angle-(theta/2);
         bx = x+Math.cos(angle)*radius;
         by = y+Math.sin(angle)*yRadius;
         cx = x+Math.cos(angleMid)*(radius/Math.cos(theta/2));
         cy = y+Math.sin(angleMid)*(yRadius/Math.cos(theta/2));
         this.curveTo(cx, cy, bx, by);
      }
      this.lineStyle(0,0x000000,0);
      this.lineTo(x, y);
   }
};
_root.createEmptyMovieClip("circulo",1);
_root.circulo.angulo = 0;
_root.circulo.onEnterFrame = function(){
   if(_root.circulo.angulo<360){
      _root.circulo.angulo--;
   }else{
      delete this.onEnterFrame;
   }
   this.clear();
   this.drawWedge(50,50,90,this.angulo,50);
}
  #2 (permalink)  
Antiguo 06/05/2011, 09:47
Avatar de 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
Respuesta: Script AS2 Circulo

Y cual es la velocidad adecuada????
  #3 (permalink)  
Antiguo 06/05/2011, 09:49
 
Fecha de Ingreso: mayo-2011
Mensajes: 3
Antigüedad: 13 años
Puntos: 0
Respuesta: Script AS2 Circulo

Cita:
Iniciado por TMeister Ver Mensaje
Y cual es la velocidad adecuada????
el doble de la velocidad que ya tiene
  #4 (permalink)  
Antiguo 06/05/2011, 12:13
 
Fecha de Ingreso: junio-2007
Mensajes: 51
Antigüedad: 16 años, 10 meses
Puntos: 1
Respuesta: Script AS2 Circulo

no lo se...
prueba a poner 36 fotogramas de reproducion en la line tiempo
  #5 (permalink)  
Antiguo 06/05/2011, 21:20
 
Fecha de Ingreso: mayo-2011
Mensajes: 3
Antigüedad: 13 años
Puntos: 0
Respuesta: Script AS2 Circulo

Cita:
Iniciado por chianale2 Ver Mensaje
no lo se...
prueba a poner 36 fotogramas de reproducion en la line tiempo
quedo igual, ya que mi pelicula debe correr a 24, y solo esa parte acelararse

Etiquetas: as2, circulo
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 06:21.