Volevo caricare le immagini in maniera casuale al caricamento della pagina tramite xml, ho trovato questo codice ma non funziona mi potreste far capire dov'è che sbaglio???
Grazie mille
codice:loadGalleryXML(); function loadDone(s) { if (s) { trace("success"); //showData (); init(); } else { trace("load failed"); } } var myXML:XMLData; //frame2_mc._alpha=0; function loadGalleryXML (xmlFile:String){ trace("loadGalleryXML"); // load the xml myxml = new XMLData("_xml/gallery1.xml", this, "loadDone"); }; frame1_mc._alpha = 01; function init (){ //trace("init"); // first image frame1_mc.load(myxml.data.large.base+myxml.data.im ages.image[randomImagePosition].path, true); frame1_mc.alphaTo(99, 1.5, "easeOutCirc"); clearInterval (setTimer); setTimer = setInterval(slideShow, 500); //var thumb:ThumbnailMaker = new ThumbnailMaker(this); //thumb.build(myxml.data.images.image, myxml.data.thumbnail.base, "GalleryThumb_id", 50, 40); }; function slideShow(){ trace("slideShow"); clearInterval(setTimer); frame2_mc.load(myxml.data.large.base+myxml.data.im ages.image[randomImagePosition].path, true); frame2_mc._alpha = 99; frame1_mc.alphaTo(01, 1.5, "easeOutCirc", 3); _root.onEnterFrame = function(){ //trace("the enter frame is firing"); if(frame1_mc._alpha <= 01){ trace("the alpha is there"); delete this.onEnterFrame; frame1_mc.load(myxml.data.large.base+myxml.data.im ages.image[randomImagePosition].path, true); frame1_mc.alphaTo(99, 1.5, "easeOutCirc", 3, slideShow); } } }

Rispondi quotando