-
loading images through xml....Preloader?
Well I have looked through several threads and I just cant seem to figure it out, idk if its the late night and i am just to tired to figure it out or if it is because I am a super noob when it comes to flash. But here is my problem, I have a slideshow that will load the images from an XML document, here is my actionscript code.
PHP Code:
myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function(success){
if(success){
loadMovie(myXML.firstChild.childNodes[0].firstChild.nodeValue, f0);
loadMovie(myXML.firstChild.childNodes[1].firstChild.nodeValue, f1);
loadMovie(myXML.firstChild.childNodes[2].firstChild.nodeValue, f2);
loadMovie(myXML.firstChild.childNodes[3].firstChild.nodeValue, f3);
loadMovie(myXML.firstChild.childNodes[4].firstChild.nodeValue, f4);
loadMovie(myXML.firstChild.childNodes[5].firstChild.nodeValue, f5);
loadMovie(myXML.firstChild.childNodes[6].firstChild.nodeValue, f6);
loadMovie(myXML.firstChild.childNodes[7].firstChild.nodeValue, f7);
loadMovie(myXML.firstChild.childNodes[8].firstChild.nodeValue, f8);
loadMovie(myXML.firstChild.childNodes[9].firstChild.nodeValue, f9);
loadMovie(myXML.firstChild.childNodes[10].firstChild.nodeValue, f10);
loadMovie(myXML.firstChild.childNodes[11].firstChild.nodeValue, f11);
loadMovie(myXML.firstChild.childNodes[12].firstChild.nodeValue, f12);
loadMovie(myXML.firstChild.childNodes[13].firstChild.nodeValue, f13);
loadMovie(myXML.firstChild.childNodes[14].firstChild.nodeValue, f14);
loadMovie(myXML.firstChild.childNodes[15].firstChild.nodeValue, p0);
loadMovie(myXML.firstChild.childNodes[16].firstChild.nodeValue, p1);
loadMovie(myXML.firstChild.childNodes[17].firstChild.nodeValue, p2);
loadMovie(myXML.firstChild.childNodes[18].firstChild.nodeValue, p3);
loadMovie(myXML.firstChild.childNodes[19].firstChild.nodeValue, p4);
loadMovie(myXML.firstChild.childNodes[20].firstChild.nodeValue, p5);
loadMovie(myXML.firstChild.childNodes[21].firstChild.nodeValue, p6);
loadMovie(myXML.firstChild.childNodes[22].firstChild.nodeValue, p7);
loadMovie(myXML.firstChild.childNodes[23].firstChild.nodeValue, p8);
loadMovie(myXML.firstChild.childNodes[24].firstChild.nodeValue, p9);
loadMovie(myXML.firstChild.childNodes[25].firstChild.nodeValue, p10);
loadMovie(myXML.firstChild.childNodes[26].firstChild.nodeValue, p11);
loadMovie(myXML.firstChild.childNodes[27].firstChild.nodeValue, p12);
loadMovie(myXML.firstChild.childNodes[28].firstChild.nodeValue, p13);
loadMovie(myXML.firstChild.childNodes[29].firstChild.nodeValue, p14);
loadMovie(myXML.firstChild.childNodes[30].firstChild.nodeValue, e0);
loadMovie(myXML.firstChild.childNodes[31].firstChild.nodeValue, e1);
loadMovie(myXML.firstChild.childNodes[32].firstChild.nodeValue, e2);
loadMovie(myXML.firstChild.childNodes[33].firstChild.nodeValue, e3);
loadMovie(myXML.firstChild.childNodes[34].firstChild.nodeValue, e4);
loadMovie(myXML.firstChild.childNodes[35].firstChild.nodeValue, e5);
loadMovie(myXML.firstChild.childNodes[36].firstChild.nodeValue, e6);
loadMovie(myXML.firstChild.childNodes[37].firstChild.nodeValue, e7);
loadMovie(myXML.firstChild.childNodes[38].firstChild.nodeValue, e8);
loadMovie(myXML.firstChild.childNodes[39].firstChild.nodeValue, e9);
loadMovie(myXML.firstChild.childNodes[40].firstChild.nodeValue, e10);
loadMovie(myXML.firstChild.childNodes[41].firstChild.nodeValue, e11);
loadMovie(myXML.firstChild.childNodes[42].firstChild.nodeValue, e12);
loadMovie(myXML.firstChild.childNodes[43].firstChild.nodeValue, e13);
loadMovie(myXML.firstChild.childNodes[44].firstChild.nodeValue, e14);
} else {
}
}
myXML.load("myImage.xml");
this is however in a movie clip called "slide".
this is my xml code from "myImage.xml"
PHP Code:
<?xml version="1.0" encoding="UTF-8"?>
<myImage>
<imagePath>images/f0.jpg</imagePath>
<imagePath>images/f1.jpg</imagePath>
<imagePath>images/f2.jpg</imagePath>
<imagePath>images/f3.jpg</imagePath>
<imagePath>images/f4.jpg</imagePath>
<imagePath>images/f5.jpg</imagePath>
<imagePath>images/f6.jpg</imagePath>
<imagePath>images/f7.jpg</imagePath>
<imagePath>images/f8.jpg</imagePath>
<imagePath>images/f9.jpg</imagePath>
<imagePath>images/f0.jpg</imagePath>
<imagePath>images/f1.jpg</imagePath>
<imagePath>images/f2.jpg</imagePath>
<imagePath>images/f3.jpg</imagePath>
<imagePath>images/f4.jpg</imagePath>
<imagePath>images/f5.jpg</imagePath>
<imagePath>images/f6.jpg</imagePath>
<imagePath>images/f7.jpg</imagePath>
<imagePath>images/f8.jpg</imagePath>
<imagePath>images/f9.jpg</imagePath>
<imagePath>images/f0.jpg</imagePath>
<imagePath>images/f1.jpg</imagePath>
<imagePath>images/f2.jpg</imagePath>
<imagePath>images/f3.jpg</imagePath>
<imagePath>images/f4.jpg</imagePath>
<imagePath>images/f5.jpg</imagePath>
<imagePath>images/f6.jpg</imagePath>
<imagePath>images/f7.jpg</imagePath>
<imagePath>images/f8.jpg</imagePath>
<imagePath>images/f9.jpg</imagePath>
<imagePath>images/f0.jpg</imagePath>
<imagePath>images/f1.jpg</imagePath>
<imagePath>images/f2.jpg</imagePath>
<imagePath>images/f3.jpg</imagePath>
<imagePath>images/f4.jpg</imagePath>
<imagePath>images/f5.jpg</imagePath>
<imagePath>images/f6.jpg</imagePath>
<imagePath>images/f7.jpg</imagePath>
<imagePath>images/f8.jpg</imagePath>
<imagePath>images/f9.jpg</imagePath>
<imagePath>images/f0.jpg</imagePath>
<imagePath>images/f1.jpg</imagePath>
<imagePath>images/f2.jpg</imagePath>
<imagePath>images/f3.jpg</imagePath>
<imagePath>images/f4.jpg</imagePath>
</myImage>
Ideally I would like my preloader on my first frame to preload these images for me here is my preloader AS
PHP Code:
onClipEvent (load) {
total = _root.getBytesTotal();
}
onClipEvent (enterFrame) {
loaded = _root.getBytesLoaded();
percent = int(loaded/total*100);
text = percent+"%";
//trace(percent)
this.gotoAndStop(percent);
if (loaded == total and total>380 and a<>1) {
a=1;
_root.gotoAndPlay(2);
}
}
I truly would appreciate anyones guidance on the matter, and thanks for your help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|