Ver Mensaje Individual
  #8 (permalink)  
Antiguo 29/01/2010, 19:50
Avatar de ClubIce
ClubIce
 
Fecha de Ingreso: diciembre-2008
Mensajes: 216
Antigüedad: 15 años, 4 meses
Puntos: 2
Respuesta: Pausar Ejecucion de JS

bueno, creo que ya entendi y como puedo modificarlo, ahora para evitar hacer mas post quiero que me ayudes en el siguiente script

Código Javascript:
Ver original
  1. Sprite=function(image,width,height,hmargin,vmargin,hspace,vspace,rows,cols) {
  2.  this.numItems=rows*cols;
  3.  image=new Image().src=image;
  4.  this.frames=new Array();
  5.  for (i=0; i<cols; i++) {
  6.   for (j=0; j<rows; i++) {
  7.    x=hmargin+(width*j)+(hspace*j)
  8.    y=vmargin+(height*i)+(vspace*i)
  9.    this.frames[i*cols+j]={image:image,width:width,height:height,x:x,y:y}
  10.   }
  11.  }
  12. }
  13.  
  14. Animation=function(spr,spd) {
  15.  this={
  16.   sprite:spr,
  17.   speed:spd,
  18.   frames:[]
  19.  };
  20. }
  21. Animation.prototype={
  22.  addFrame: function (id) {
  23.   spr=this;
  24.   this.frames[frames.length]={
  25.    id:id,
  26.    sprite:"url('"+spr.sprite.image.src+"') "+spr.sprite.frames[id].x+"px "+spr.sprite.frames[id].y+"px;"
  27.   }
  28.  },
  29.  drawAnimation:function (container, id) {
  30.   image=createElement('img')
  31.   image.setAtributte('src','empy.gif')
  32.   image.setAtributte('style',"background:"+this.frames[0].sprite)
  33.   image.setAtributte('class','animation')
  34.   image.setAttribute('id',id)
  35.   container.appendChild(image)
  36.   this.id=id
  37.   this.Play();
  38.  }
  39. }

la consola de erroes me dice:

Error: invalid assignment left-hand side
Línea: 19, columna: 5
Código fuente:
this={

no se que es lo que causa el error ya he intentado muchas cosas

PS: perdon por los errores del script, es que es hecho a mano

Última edición por ClubIce; 29/01/2010 a las 20:22