Comunidad de diseño web y desarrollo en internet online

Ayuda con la funcion timer en AS3

Citar            
MensajeEscrito el 09 Abr 2009 12:12 am
Hola mi problema es, tengo una galeria de imagenes que va pasando, necesito que la imagen se detenga unos 5 segundo s y luego continue, me parece que es con la funcion timer, pero despues de intentarlo de varias formas no eh podido resolverlo.. Gracias

Por xerot

1 de clabLevel



 

firefox
Citar            
MensajeEscrito el 09 Abr 2009 04:51 pm
prueba esto:

Código ActionScript :

private var myTimer:Timer = new Timer(5000);
private function init():void{
   //imgProd es un componente image
   imgProd.load('imagen1.jpg')
   myTimer.addEventListener("timer", cambiaImg);
   myTimer.start();
}
         
private function cambiaImg(event:TimerEvent):void{
   imgProd.load('otra_imagen.jpg')
}


espero que te sirva de algo

saludos ;)

_________________
Necesitas una agenda para tus pacientes? Agenda Business Customer http://www.ddsmedia.net

Por isantos

22 de clabLevel



 

Pachuca | Hgo | México

firefox
Citar            
MensajeEscrito el 10 Feb 2010 06:17 pm
Como crearias un timer para recuperar la informacion de este codigo cada cierto tiempo?...donde Cada cierto tiempo= 2 o 3 minutos :D

//-- importamos las clases necesarias
import flash.net.*;
import flash.events.*;
import flash.text.TextField;
//-- creamos una instancia de URLLoader para info externa
var loader:URLLoader=new URLLoader();
//-- tipo de info a recibir
loader.dataFormat=URLLoaderDataFormat.VARIABLES;
//-- cual es el archivo que cargaremos
loader.load(new URLRequest("http://estelarisradio.net/mostrar.php"));
//-- listener para cuando la carga este completa
loader.addEventListener(Event.COMPLETE,carga);
//-- funcion a ejecutarse
function carga(event:Event) {
var loader:URLLoader= URLLoader(event.target);
//-- creamos el campo de texto donde se mostrara la info del php
//-- creamos el campo de texto donde se mostrara la info del php
var texto:TextField = new TextField();
texto.type = TextFieldType.DYNAMIC;
texto.border = true;
texto.height = 20;
texto.width = 300;
texto.textColor = 0x0033FF;
texto.x = 0;
texto.y = 0;
texto.text=String(loader.data.dato2);
addChild(texto);

var texto2:TextField = new TextField();
texto2.type = TextFieldType.DYNAMIC;
texto2.border = true;
texto2.height = 20;
texto2.width = 300;
texto.textColor = 0x0033FF;
texto2.x = 310;
texto2.y = 0;
texto2.text=String(loader.data.dato1);
addChild(texto2);
}


Saludos :)

Por Gabrielito_07

7 de clabLevel



Genero:Masculino  

2 Meses

msie7

 

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