Comunidad de diseño web y desarrollo en internet online

Condicional para un frame posterior

Citar            
MensajeEscrito el 19 Abr 2008 09:38 pm
Estoy escribiendo el código del AS en el frame 1 para un determinado movieclip

// MovieClip mcIdiomas;

// OVIDORES DE EVENTOS

mcIdiomas.addEventListener(Event.ENTER_FRAME, dondeEstoy);

// FUNCIONES DE EVENTO

function dondeEstoy (evento:Event):void
{
if ( currentFrame == 1 )
{
trace ( "Estoy en el frame 1" );
}
//Aqui quiero colocar un condicional para cuando la TimeLine esté en el frame 25
{
trace ( "Estoy en el frame 25" );
}
}

Cómo debe ser ese condicional?

Desde ya muchas gracias.

Por Ishkandar

Claber

303 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 19 Abr 2008 10:17 pm
Solo tienes que poner un else para cuando se cumpla esa condición:

Código :

function dondeEstoy(evento:Event):void
{
   if ( currentFrame == 1 )
   {
      trace( "Estoy en el frame 1" );
   }
   else if ( currentFrame == 25 )
   {
      trace( "Estoy en el frame 25" );
   }
}

Por Zguillez

BOFH

10744 de clabLevel

85 tutoriales
17 articulos
3 ejemplos

Genero:Masculino   Bastard Operators From Hell Héroes Team Cristalab Editores

BCN

clabbrowser
Citar            
MensajeEscrito el 20 Abr 2008 11:21 am
Funcionó para el 25 pero no se porque no está traceando para el frame 1

//MovieClip mcBola;

mcBola.addEventListener( Event.ENTER_FRAME, dondeEstoy );

function dondeEstoy ( evento:Event ):void
{
if ( currentFrame == 1 )
{
trace( "Estoy en el frame 1" );
}
else if ( currentFrame == 25 )
{
trace( "Estoy en el frame 25" );
mcBola.removeEventListener(Event.ENTER_FRAME, dondeEstoy);
}
}

Por Ishkandar

Claber

303 de clabLevel



Genero:Masculino  

firefox

 

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