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

establecer frameRate distinto para un MC

Estas en el tema de establecer frameRate distinto para un MC en el foro de Flash y Actionscript en Foros del Web. Hola. Quisiera reproducir un MC hacia atrás y se me ha ocurrido establecer el frameRate negativo, pero no sé cómo se hace. Si se os ...
  #1 (permalink)  
Antiguo 03/02/2008, 11:18
 
Fecha de Ingreso: diciembre-2007
Mensajes: 60
Antigüedad: 16 años, 4 meses
Puntos: 1
establecer frameRate distinto para un MC

Hola.

Quisiera reproducir un MC hacia atrás y se me ha ocurrido establecer el frameRate negativo, pero no sé cómo se hace.

Si se os ocurre otra cosa, agradezco vuestra ayuda.



Gracias a todos.
  #2 (permalink)  
Antiguo 03/02/2008, 13:41
Avatar de Bandit
Moderador
 
Fecha de Ingreso: julio-2003
Ubicación: Lima - Perú
Mensajes: 16.726
Antigüedad: 20 años, 9 meses
Puntos: 406
Re: establecer frameRate distinto para un MC

Hola mikarts:
Aquí tienes un ejemplo para avanzar y retroceder:
Crea 2 botones: Avanzar y Retroceder
Dentro del MC debe de haber en el primero y último frame un stop();
Al MC le pones como nombre de instancia: mi_mc.
Al MC le pones éste código:
onClipEvent (enterFrame) {
if (_root.retroceda==true) {
prevFrame();
if (_currentframe==1) {
_root.retroceda=false;
}
}
}
Al botón avanzar:
on (release) {
with (mi_mc) {
gotoAndPlay(_currentframe);
}
}
Al botón retroceder:
on (release) {
_root.retroceda=true;
}

Espero haberte sido de ayuda.
__________________
Bandit.
Si no sabes estudia y si sabes enseña.
http://www.banditwebdesign.com/
  #3 (permalink)  
Antiguo 04/02/2008, 13:54
 
Fecha de Ingreso: diciembre-2007
Mensajes: 60
Antigüedad: 16 años, 4 meses
Puntos: 1
Re: establecer frameRate distinto para un MC

Muchas gracias, me ha servido mucho.
Exactamente necesitaba que se ejecutara automáticamente y que continuase al finalizar tanto en un sentido como en el otro así que lo he modificado un poco:

Es un MC de 200 frames.
Los botones están dentro del MC.

Código del MC (en el raíz):
onClipEvent (enterFrame) {
if (_root.retroceda == true) {
if (_currentframe == 1) {
this.gotoAndPlay("200");
} else {
prevFrame();
}
}
if (_root.retroceda == false) {
if (_currentframe == 200) {
this.gotoAndPlay("1");
} else {
nextFrame();
}
}
}

En el MC:
En el primer frame:
if (_root.retroceda == false) {
nextFrame();
}

En el último frame:
if (_root.retroceda == true) {
prevFrame();
}

Esto es porque si no lo pongo se queda parado al intentar reiniciar o hace una parada de un frame.

Botón AVANZAR:
on (release) {
_root.retroceda = false;
}

Botón RETROCEDER:
on (release) {
_root.retroceda = true;
}

Eso es todo.

Muchas gracias.

Sois geniales.

Última edición por mikarts; 04/02/2008 a las 15:03
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

SíEste tema le ha gustado a 1 personas (incluyéndote)




La zona horaria es GMT -6. Ahora son las 16:03.