ActionScript XML解析器
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ActionScript XML解析器相关的知识,希望对你有一定的参考价值。
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; } }
以上是关于ActionScript XML解析器的主要内容,如果未能解决你的问题,请参考以下文章