hi I have an xml based image gallery(from this forum) that I have load pics and thumbs and I just tried to add a get url link in to open up urls in a _blank page. when clicked, however, a new window opens up, but says “undefined”.some one suggested using the id value, but I’m not sure how to. can anyone help. thanks.
here is the main part of the code in flash:
var tnNr;
spacing = 10;
container._alpha = 0;
var curLength;
MovieClip.prototype.loadPic = function(pic, id, link) {
// txt eventually for links
txMe2.info.text = “”;
this._alpha = 0;
this.loadMovie(pic);
temp = this._parent.createEmptyMovieClip(“temp2”, 998);
temp.onEnterFrame = function() {
var t = container.getBytesTotal(), l = container.getBytesLoaded();
if (Math.round(l/t) == 1 && container._width != 1 && container._height != 0) {
var w = container._width+spacing, h = container._height+spacing;//was _width+spacing
border.resizeMe(w, h,);
delete this.onEnterFrame;
}
};
};
here is the important part of the array code. I now put the getURL underneath the push. array:
function galleryChoice(q) {
pArray = new Array();
tArray = new Array();
iArray = new Array();
rArray = new Array();
my_xml = new XML();
for (var j = 0; j<curLength; j++) {
this.scroll.th_nav[“thmb”+j].removeMovieClip();
}
my_xml.ignoreWhite = true;
my_xml.onLoad = function(loaded) {
if (loaded) {
gallery = this.firstChild.childNodes[q];
curLength = gallery.childNodes.length;
for (var i = 0; i<gallery.childNodes.length; i++) {
pArray.push(gallery.childNodes*.attributes.source);
tArray.push(gallery.childNodes*.attributes.thumb);
iArray.push(gallery.childNodes*.attributes.title);
rArray.push(gallery.childNodes*.attributes.link);
//
txMe2.onRelease = function() {
getURL(link*,"_blank");
};
}
}
delay = setInterval(makeButtons, 50);
};
my_xml.load("websites_full.xml");
}
Here is the Xml:
<?xml version=“1.0” encoding=“UTF-8”?>
<menu>
<gallery name=“Websites”>
<image source=“pics/austin.jpg” thumb=“pics/austin_thmb.jpg” title=“http://austinirving.com” link=“http://austinirving.com”/>
<image source=“pics/sopheColle.jpg” thumb=“pics/sopheColle_thmb.jpg” title=“http://sophiecolle.com” link=“http://sophiecolle.com”/>
</gallery>
</gallery>
any help would be appreciated:rap: