Comunidad de diseño web y desarrollo en internet online

set interval????

Citar            
MensajeEscrito el 27 May 2010 08:48 pm
Hola, estoy haciendo un slideshow con 3 imagenes en xml que mando llamar con actionscript en un flash en un movieclip "vacio", el caso es que me carga la ultima imagen y ya no pasa nada más
este es mi codigo a ver si me pueden ayudar por fa!!


var arreglo = new Array ();
var xml = new XML ();
xml.ignoreWhite = true;
xml.onLoad = function ()
{
for (var i = 0; i < this.firstChild.childNodes.length; i++)
{
arreglo[i] = xml.firstChild.childNodes[i].attributes.id;
setInterval(cargarimg(i), 1000);
trace("cargo funcion");
}
};
function cargarimg(i){
loadMovie(arreglo[i],vacio);
trace("cargo foto");
}
xml.load ("imgs.xml");

Por ddm333

8 de clabLevel



 

msie8
Citar            
MensajeEscrito el 27 May 2010 10:05 pm

Código ActionScript :

var arreglo = new Array ();
var imagen = 0;
var segundos = 10;
var xml = new XML ();
xml.ignoreWhite = true;
xml.onLoad = function ()
{
for (var i = 0; i < this.firstChild.childNodes.length; i++)
{
arreglo[i] = xml.firstChild.childNodes[i].attributes.id;
trace("cargo funcion");
}
setInterval(cargarimg, 1000*segundos); //1000 es 1 seg
};
function cargarimg(){
loadMovie(arreglo[imagen],vacio);
imagen = (imagen<arreglo.length) ? imagen++ : 0;
trace("cargo foto");
}
xml.load ("imgs.xml"); 

Por nasho

Claber

908 de clabLevel

1 tutorial

Genero:Masculino  

Web Developer

firefox
Citar            
MensajeEscrito el 28 May 2010 12:39 am
uuhh no sale jaja

Por ddm333

8 de clabLevel



 

msie8
Citar            
MensajeEscrito el 28 May 2010 01:57 am
el id tiene el url de cada imagen?

Por nasho

Claber

908 de clabLevel

1 tutorial

Genero:Masculino  

Web Developer

firefox
Citar            
MensajeEscrito el 02 Jun 2010 01:30 am
uuu ya lo conseguí muchas gracias a ver si al rato lo subo! para que otros lo puedan usar!

Por ddm333

8 de clabLevel



 

msie8

 

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