I didn’t seem to need to close the dynamically loaded thumbnails until I added the javascript for SWFObject. Now when I click on of the navigation buttons to go to another page it leaves the thumbnails on top of the next page. What is the best way to fix this? Is there a way to add something to the nav buttons to close the xml or to clear it or is there a better way entirely? :hr:
Here is the loadXML actionscript:
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
thumbnails = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
description* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
thumbnails* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
}
sload();
firstImage();
} else {
content = “file not loaded!”;
}
}
this.createEmptyMovieClip(“kk”, 1029);
kk._x = 140.9;
kk._y = kk.starty=200.9;
kk.setMask(mm)
btn.enabled = false
function drawSquare(clip, depth, colour, x, y, w, h) {
var mc = clip.createEmptyMovieClip(“clip”+depth, depth);
mc._x = x;
mc._y = y;
mc.lineStyle(lineWidth, color, 0);
mc.beginFill(0x000000);
mc.lineTo(w, 0);
mc.lineTo(w, h);
mc.lineTo(0, h);
mc.endFill();
return mc;
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load(“image.xml”);
and the java from SWFobject:
(in header): <script type=“text/javascript” src=“js/swfobject.js”></script>
(in body):
<div id=“flashcontent”>
</div>
<script type=“text/javascript”>
var so = new SWFObject(“movie.swf”, “content”, “800”, “600”, “6”, “#000000”);
so.write(“flashcontent”);
</script>