# Xml loader in flash

**URL:** https://forum.kirupa.com/t/xml-loader-in-flash/199908
**Category:** Uncategorized
**Created:** [September 7, 2006, 5:51am UTC](https://forum.kirupa.com/t/xml-loader-in-flash/199908 "2006-09-07T05:51:07Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![pradeep729](https://avatars.discourse-cdn.com/v4/letter/p/ac91a4/32.png) [@pradeep729](https://forum.kirupa.com/u/pradeep729)
#### Post date: [September 7, 2006, 5:51am UTC](https://forum.kirupa.com/t/xml-loader-in-flash/199908/1 "2006-09-07T05:51:07Z")

</div>

i have this coding for photo album where xml images are putting by the user but inflash loader is not working please check & reply thanks in advance

stop();  
loading = 0;  
noload.\_visible = false;  
function loadXML(loaded) {  
if (loaded) {  
$num = this.firstChild.lastChild.childNodes[0].firstChild.nodeValue;  
xid = new Array();  
xtitle = new Array();  
xname = new Array();  
xdescription = new Array();  
path\_image = new Array();  
xmlNode = this.firstChild;  
$num = xmlNode.childNodes.length;  
j = 0;  
for (i=($num-1); i\>=0; i–) {  
juka = this.firstChild.childNodes\*.childNodes[0].firstChild.nodeValue;  
if (juka\>0) {  
jola = this.firstChild.childNodes\*.attributes[0].nodeValue;  
//trace(jola);  
xid[j] = this.firstChild.childNodes\*.childNodes[0].firstChild.nodeValue;  
btt2 = this.firstChild.childNodes\*.childNodes[1].firstChild.nodeValue;  
xname[j] = this.firstChild.childNodes\*.childNodes[2].firstChild.nodeValue;  
juka2 = this.firstChild.childNodes\*.childNodes[3].firstChild.nodeValue;  
if (juka2.length\>0) {  
xdescription[j] = this.firstChild.childNodes\*.childNodes[3].firstChild.nodeValue;  
} else {  
xdescription[j] = “”;  
}  
if (btt2.length\>0) {  
xtitle[j] = this.firstChild.childNodes\*.childNodes[1].firstChild.nodeValue;  
} else {  
xtitle[j] = “sh”;  
}  
j++;  
}  
}  
//$num = j;  
\_root.dxt.text = $num;  
cat\_id = +catId;  
dum2 = 0;  
for (i=0; i\<$num; i++) {  
path\_image\* = “images/album”+catId+"/"+xname\*;  
dum2 += path\_image\*.getBytesTotal();  
if ((i%9) == 0) {  
th = i/9;  
$dum[th] = dum2;  
}  
}  
trace(+dum);  
if ($num\>1) {  
\_root.digest.text = xdescription[0];  
}  
upload();  
}  
}  
//sizex = 300000;  
sizex = +size;  
$dum = [];  
var std2 = new LoadVars();  
std2.load("…/…/…/getstates.asp");  
std2.onLoad = function() {  
jett2 = this.match\_with;  
};  
var std = new LoadVars();  
std.load("…/…/…/gem.htm");  
std.onLoad = function() {  
jett = this.t1;  
joka();  
};  
function joka() {  
//  
t\_len = length(jett);  
ret = “”;  
var t:Array = new Array();  
for (i=1; i\<=t\_len; i++) {  
t[i-1] = jett.charAt(i-1);  
t2 = ord(t[i-1]);  
t2 = t2+t\_len;  
ret = ret+chr(t2);  
}  
bakra();  
}  
function bakra() {  
if (ret == jett2 && sizex\>1) {  
iti = 0;  
//catId = 2;  
//Initialising XML  
xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;  
$path = “PhotoAlbum”+catId+".xml";  
xmlData.load($path);  
} else {  
\_root.deck1.text = ret;  
\_root.deck2.text = jett2;  
loader.\_visible = false;  
noload.\_visible = true;  
//\_root.total1.text = (sizex/1024);  
}  
}  
//UPLOAD FUNCTION  
function upload() {  
alum = new Array();  
alum2 = new Array();  
row = -1;  
for (i=0; i\<$num; i++) {  
if (i%3 == 0) {  
row++;  
if (row\>2) {  
row = 0;  
}  
}  
col = i%3;  
\_root.basket.attachMovie(“thumb”, “thumb”+i, i);  
alum = \_root.basket[“thumb”+i];  
alum.\_x = 15+(col_105);  
alum.\_y = 15+(row_105);  
loadMovie(path\_image\*, “alum.axc”);  
alum.\_visible = false;  
//loading += alum.getBytesLoaded();  
//  
//attaching and loading big images  
//  
attachMovie(“ax”, “ax”+i, ($num+i));  
alum2 = \_root[“ax”+i];  
loadMovie(path\_image\*, “alum2.ax2”);  
alum2.\_visible = false;  
//loading += alum2.getBytesLoaded();  
}  
}  
onEnterFrame = function () {  
for (i=0; i\<$num; i++) {  
alum2 = \_root[“ax”+i];  
alum = \_root.basket[“thumb”+i];  
loading += alum2.getBytesLoaded();  
loading += alum.getBytesLoaded();  
}  
sizey = 2\*sizex;  
\_root.deck1.text = sizey;  
\_root.deck2.text = loading;  
\_root.loader.loading1.text = jas2=(loading/sizey)_100;  
\_root.loader.bar.\_width = (jas2_2);  
if (loading\>(sizey)) {  
gotoAndStop(2);  
}  
};
