# Loading url from XML into getURL is undefined

**URL:** <https://forum.kirupa.com/t/loading-url-from-xml-into-geturl-is-undefined/266149>\
**Category:** flash\
**Created:** [July 16, 2008, 7:21pm UTC](https://forum.kirupa.com/t/loading-url-from-xml-into-geturl-is-undefined/266149 "2008-07-16T19:21:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![4LeggedHobey](https://avatars.discourse-cdn.com/v4/letter/4/8dc957/32.png) [@4LeggedHobey](https://forum.kirupa.com/u/4LeggedHobey)\
**Post date:** [July 16, 2008, 7:21pm UTC](https://forum.kirupa.com/t/loading-url-from-xml-into-geturl-is-undefined/266149/1 "2008-07-16T19:21:38Z")

</div>

I have been learning how to use arrays and have come across a problem that my learning style of trial and error hasn’t seemed to be able to solve. I have three different buttons in flash and am trying to get them to each load a different external webpage onRelease.The other stuff from the xml loads fine, but for some reason this keeps showing up as “undefined.” Why is that? (Learning is hard! 🙂 )

```auto
importXML = new XML();
importXML.ignoreWhite = true;
importXML.onLoad = function(success) {
    if (success) {
        var root = this.firstChild;
        for (var i = root.firstChild; i != null; i=i.nextSibling) {
            aCaption.push(i.attributes.caption);
            aImage.push(i.attributes.img);
            aLink.push(i.attributes.link);
        }
        populate();
    }
};
importXML.load("gallery2.xml");
var aCaption = new Array();
var aImage = new Array();
var aLink = new Array();
function populate() {
    for (i=0; i<aCaption.length; i++) {
        this["box"+(i+1)+"_txt"].htmlText = aCaption*;
        this["image"+(i+1)+"_img"].loadMovie("images/"+aImage*);
        this["link"+(i+1)+"_btn"].onRelease = function(){
            getURL(aLink*, "_blank");
        }
    }
}

```

xml looks like this:

```auto
    <option caption="Blue 1" img="image1.jpg" link="http://www.google.com"/>

```
