# Help with making xml links opens urls in new page

**URL:** <https://forum.kirupa.com/t/help-with-making-xml-links-opens-urls-in-new-page/214748>\
**Category:** Uncategorized\
**Created:** [January 31, 2007, 6:15pm UTC](https://forum.kirupa.com/t/help-with-making-xml-links-opens-urls-in-new-page/214748 "2007-01-31T18:15:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rmcnaugh](https://avatars.discourse-cdn.com/v4/letter/r/839c29/32.png) [@rmcnaugh](https://forum.kirupa.com/u/rmcnaugh)\
**Post date:** [January 31, 2007, 6:15pm UTC](https://forum.kirupa.com/t/help-with-making-xml-links-opens-urls-in-new-page/214748/1 "2007-01-31T18:15:19Z")

</div>

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”. can anyone help. thanks.

here is the code in flash:

var tnNr;  
spacing = 10;  
container.\_alpha = 0;  
var curLength;  
MovieClip.prototype.loadPic = function(pic, id) {  
// 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, id);  
delete this.onEnterFrame;  
}  
};  
};  
MovieClip.prototype.resizeMe = function(w, h, id) {  
var speed = 5;  
container.\_alpha = 0;  
this.onEnterFrame = function() {  
this.\_width += (w-this.\_width)/speed;  
this.\_height += (h-this.\_height)/speed;  
if (Math.abs(this.\_width-w)\<1 && Math.abs(this.\_height-h)\<1) {  
this.\_width = w;  
this.\_height = h;  
container.\_x = this.\_x-this.\_width/2+spacing/2;  
container.\_y = this.\_y-this.\_height/2+spacing/2;  
//info.\_y = Math.round(this.\_y+this.\_height/2+spacing/2);  
container.\_alpha += 9;  
if (container.\_alpha\>90) {  
//Color, Press txt to open new link in in \_blank window  
txMe2.info.text = id;  
txMe2.onRollOver = function() {  
txMe2.info.textColor = 0x00ff00;  
}  
txMe2.onRollOut= function() {  
txMe2.info.textColor = 0xffffff;  
}  
txMe2.onRelease = function() {  
getURL(link\*,"\_blank");  
};  
container.\_alpha = 100;  
delete this.onEnterFrame;  
}  
}  
};  
};  
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);

```
        }
    }
    delay = setInterval(makeButtons, 50);
};
my_xml.load("websites_full.xml");

```

}  
function makeButtons() {  
tnNr = 0;  
clearInterval(delay);  
for (var i = 0; i\<tArray.length; i++) {  
var thb = scroll.th\_nav.thmb.duplicateMovieClip(“thmb”+i, 1000+i);  
thb.id = i;  
thb.\_x = i%3_50;  
thb.\_y = Math.floor(i/3)50;  
}  
loadButtons();  
}  
function loadButtons() {  
var tbox = scroll.th\_nav[“thmb”+tnNr].box;  
tbox.loadMovie(tArray[tnNr]);  
temp = this.createEmptyMovieClip(“tmp”+tnNr, 999);  
temp.onEnterFrame = function() {  
bt = tbox.getBytesTotal();  
bl = tbox.getBytesLoaded();  
if (bt == bl && bt\>4) {  
nextButton();  
delete this.onEnterFrame;  
}  
};  
}  
function nextButton() {  
if (tnNr\<tArray.length-1) {  
tnNr++;  
loadButtons();  
} else {  
activateButtons();  
}  
}  
function activateButtons() {  
mainButtons();  
for (var i = 0; i\<pArray.length; i++) {  
var but = scroll.th\_nav[“thmb”+i];  
but.id = i;  
but.onRelease = function() {  
container.loadPic(pArray[this.id], iArray[this.id]);  
disButtons2(this.id);  
};  
}  
container.loadPic(pArray[0], iArray[0]);  
disButtons2(0);  
}  
butArray = new Array();  
//butArray = [“gala\_btn”];  
butArray = [“art”, “video”, “music”, “biography”, “contact”];  
function mainButtons() {  
for (var i = 0; i\<butArray.length; i++) {  
this[butArray].id = i;  
this[butArray_].onRelease = function() {  
galleryChoice(this.id);  
disButtons(this.id);  
};  
}  
}  
function disButtons2(d) {  
for (var i = 0; i\<tArray.length; i++) {  
if (i != d) {  
this.scroll.th\_nav[“thmb”+i].enabled = 1;  
this.scroll.th\_nav[“thmb”+i].box.\_alpha = 100;  
} else {  
this.scroll.th\_nav[“thmb”+i].enabled = 0;  
this.scroll.th\_nav[“thmb”+i].box.\_alpha = 50;  
}  
}  
}  
function disButtons(d) {  
for (var i = 0; i\<butArray.length; i++) {  
if (i != d) {  
this[butArray\*].enabled = 1;  
this[butArray\*].gotoAndStop(1);  
} else {  
this[butArray\*].enabled = 0;  
this[butArray\*].gotoAndStop(2);  
}  
}  
}  
disButtons(0);  
galleryChoice(0);

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](http://austinirving.com)” link=“[http://austinirving.com](http://austinirving.com)”/\>  
\<image source=“pics/sopheColle.jpg” thumb=“pics/sopheColle\_thmb.jpg” title=“[http://sophiecolle.com](http://sophiecolle.com)” link=“[http://sophiecolle.com](http://sophiecolle.com)”/\>  
\</gallery\>  
\</gallery\>

any help would be appreciated:rap:
