/ Published in: ActionScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
gallery = "xml/"+ _root.xmlFileVariable + ".xml"; photo = 0; Photos_xml = new XML(); Photos_xml.onLoad = loadPhotos; Photos_xml.load(gallery); Photos_xml.ignoreWhite = true; function loadPhotos(success) { if (success == true) { rootNodePhotos = Photos_xml.firstChild; totalPhotos = rootNodePhotos.childNodes.length; currentNodePhotos = rootNodePhotos.firstChild; descriptions = new Array(totalPhotos); PhotoUrl = new Array(totalPhotos); BigUrl = new Array(totalPhotos); links = new Array(totalPhotos); titles = new Array(totalPhotos); price = new Array(totalPhotos); swf = new Array(totalPhotos); dx = 0; for (i=0; i < totalPhotos; i++) { descriptions[i] = currentNodePhotos.firstChild.nodeValue; PhotoUrl[i] = currentNodePhotos.attributes.PhotoUrl; BigUrl[i] = currentNodePhotos.attributes.BigUrl; links[i] = currentNodePhotos.attributes.link; titles[i] = currentNodePhotos.attributes.title; price[i] = currentNodePhotos.attributes.price; swf[i] = currentNodePhotos.attributes.swf; _root.images.attachMovie("photo","img"+i,i+300); _root.images["img"+i]._x = dx; _root.images["img"+i]._y = 0; _root.images["img"+i].k = i; dx = dx + 330; _root.images["img"+i].Url = PhotoUrl[i]; _root.images["img"+i].BigUrl = BigUrl[i]; _root.images["img"+i].link = links[i]; _root.images["img"+i].title = titles[i]; _root.images["img"+i].swf = swf[i]; if (!price[i]){ _root.images["img"+i].price = ""; }else{ _root.images["img"+i].price = price[i]; } currentNodePhotos = currentNodePhotos.nextSibling; } play(); _root.Move = true; } }