# AS3/ XML navigateToURL not opening the correct xml url

**URL:** <https://forum.kirupa.com/t/as3-xml-navigatetourl-not-opening-the-correct-xml-url/293059>\
**Category:** flash\
**Created:** [July 22, 2009, 5:38pm UTC](https://forum.kirupa.com/t/as3-xml-navigatetourl-not-opening-the-correct-xml-url/293059 "2009-07-22T17:38:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wuzzi2ya](https://avatars.discourse-cdn.com/v4/letter/w/e79b87/32.png) [@wuzzi2ya](https://forum.kirupa.com/u/wuzzi2ya)\
**Post date:** [July 22, 2009, 5:38pm UTC](https://forum.kirupa.com/t/as3-xml-navigatetourl-not-opening-the-correct-xml-url/293059/1 "2009-07-22T17:38:19Z")

</div>

With this code my button which contains the navigateToURL function opens my browser to [yahoo.com](http://yahoo.com) regardless of the url in the xml. Please review my code and let me know if you can see the problem.  
Thanks for any help

```auto
//variables:
stop();
var xmlData:XML = new XML();
var picList:XMLList = new XMLList();
var currentPic:int = 0;
var myTimer:Timer = new Timer(5000);
var loader:URLLoader = new URLLoader();
var glow:GlowFilter = new GlowFilter();
var noglow:GlowFilter = new GlowFilter();
var url:XMLList = new XMLList();
var Request:URLRequest = new URLRequest(url);
 
//functions
function onComplete(e:Event):void {
        myTimer.start();
        xmlData = new XML(loader.data);
        picList = xmlData.image;
        url = xmlData.image.url;
        updatePic(currentPic);
}
 
//how the xml is parsed
function updatePic(index:int):void {
 
        if (picList[index].url == undefined) {
                txtBox_mc.getTix.visible = false;
                trace("button null");
        } else {
                txtBox_mc.getTix.visible = true;
                trace("button there");
        }
        txtBox_mc.getTix.url = picList[index].url;
        txtBox_mc.EventHeader.htmlText = picList[index].caption1;
        txtBox_mc.EventDate.htmlText = picList[index].caption2;
        txtBox_mc.EventPlace.htmlText = picList[index].caption3;
        trace(picList[index].url);
        trace(picList[index].caption1);
        trace(picList[index].caption2);
        trace(picList[index].caption3);
        trace(index);
}
 
//function from button CLICK
function GetUrTix(event:MouseEvent):void {
        navigateToURL(Request);
}
 
<!--XML-->
<?xml version="1.0" encoding="UTF-8" ?>
<slideshow>
 
        <image>
                <url>http://www.cubiccreative.com</url>
                <caption1>This is the show</caption1>
                <caption2>September 14-15</caption2>
                <caption3>Where Else</caption3>
        </image>
 
        <image>
        
                <caption1>What a Show</caption1>
                <caption2>August 14-15</caption2>
                <caption3>Where is It</caption3>
        </image>
 
        <image>
                <url>http://www.cubiccreative.com</url>
                <caption1>Jazz Hands</caption1>
                <caption2>December 14-15</caption2>
                <caption3>Tuen Left at the Sign</caption3>
        </image>
 
</slideshow>

```
