Comunidad de diseño web y desarrollo en internet online

Simular gravedad... error XD

Citar            
MensajeEscrito el 08 Feb 2007 05:46 pm
Buenas, tengo un problemilla a la hora de simular gravedad en flash, estoy siguiendo el tutorial de la pelotita q rebota contra el suelo.

Este es el codigo q estoy usando:

onClipEvent (mouseDown) {
this.status = "bajando";
this.velocidad = 0;
this.alturaSuelo = _root.suelo._y;
}
onClipEvent (enterFrame) {
if (status == "bajando") {
this._y += velocidad;
velocidad += 1; }
else if (status == "subiendo") {
this._y -= velocidad;
velocidad -= 1;
if (velocidad<=0) {
status = "bajando";
}
}
}

onClipEvent (enterFrame) {
if (status == "bajando") {
this._y += velocidad;
velocidad +=1;
if (this ._ y>=alturaSuelo) { <<<<<<<<<<<< LINEA 23
status = "subiendo";
velocidad = velocidad*0.5;
}

Y me sale este error:
**Error** Escena=Scene 1, capa=logo, fotograma=1:Línea 23: Se espera ')'
if (this ._ y>=alturaSuelo) {

Ayudita please :)

Por sosfactory

135 de clabLevel

1 tutorial

 

msie
Citar            
MensajeEscrito el 08 Feb 2007 06:38 pm
<code>
onClipEvent (enterFrame) {
if (status == "bajando") {
this._y += velocidad;
velocidad +=1;
if (this ._ y>=alturaSuelo) { <<<<<<<<<<<< LINEA 23
status = "subiendo";
velocidad = velocidad*0.5;
}
</code>
segun yo:
te falta cerrar las llaves tanto de evento como del primer if
pero checale bien de todos modos.

Por kaiser

26 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 08 Feb 2007 08:50 pm
Entonces como quedaria?

Ni que decir q no tengo ni idea de lo que estoy haciendo :P

Por sosfactory

135 de clabLevel

1 tutorial

 

msie
Citar            
MensajeEscrito el 08 Feb 2007 09:07 pm

Código :

onClipEvent (mouseDown) {
   this.status = "bajando";
   this.velocidad = 0;
   this.alturaSuelo = _root.suelo._y;
}
onClipEvent (enterFrame) {
   if (status == "bajando") {
      this._y += velocidad;
      velocidad += 1;
   } else if (status == "subiendo") {
      this._y -= velocidad;
      velocidad -= 1;
      if (velocidad<=0) {
         status = "bajando";
      }
   }
}
onClipEvent (enterFrame) {
   if (status == "bajando") {
      this._y += velocidad;
      velocidad += 1;
   }
   if (this._y>=alturaSuelo) {
      status = "subiendo";
      velocidad = velocidad*0.5;
   }
}


Recuerda que por cada " { " debe haber un " } ".

Saludos

Por infernalpr

236 de clabLevel



 

LoL

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.