# Link to site

**URL:** <https://forum.kirupa.com/t/link-to-site/311759>\
**Category:** flash\
**Created:** [July 15, 2010, 4:06pm UTC](https://forum.kirupa.com/t/link-to-site/311759 "2010-07-15T16:06:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcacuracl](https://avatars.discourse-cdn.com/v4/letter/j/b38774/32.png) [@jcacuracl](https://forum.kirupa.com/u/jcacuracl)\
**Post date:** [July 15, 2010, 4:06pm UTC](https://forum.kirupa.com/t/link-to-site/311759/1 "2010-07-15T16:06:42Z")

</div>

I need help. I am trying to create a button that link to a website and I cannot for the life of me get my flash to open a new window to a site. I am trying to have specific links to different sites for each slide, I’m not sure how to get it working. I get an error message of:  
TypeError: Error #2007: Parameter url must be non-null.  
at global/flash.net::navigateToURL()  
at MethodInfo-119()

If you could help, Thanks!

my script is the following:

import fl.transitions._;  
import fl.transitions.easing._;  
var imageWidth:Number = 0;  
var imageHeight:Number =0;  
var configXML:XML;  
var xmlLoader:URLLoader = new URLLoader();  
var imageToLoad:Number = -1;  
var loadStatusTimer:Timer = new Timer(10);  
var selectorX:Number = 0;  
var selectorY:Number = 0;  
loadStatusTimer.addEventListener(TimerEvent.TIMER, checkLoadStatus);  
xmlLoader.addEventListener(Event.COMPLETE, configDataLoaded);  
function positionSelector() {  
[//mcSelector.x](https://mcSelector.x) = selectorX;  
mcFeatureSelector.x = 0;  
mcFeatureSelector.y = selectorY;  
}  
function resizeMainLoader(){  
mcMainLoader.mcBG.width = imageWidth;  
mcMainLoader.mcBG.height = imageHeight;  
mcMainLoader.mcLoading.x = imageWidth / 2;  
mcMainLoader.mcLoading.y = imageHeight / 2;  
mcMainLoader.mcProgress.x = imageWidth /2 ;  
mcMainLoader.mcProgress.y = imageHeight/ 2 + 20  
mcMainLoader.mcProgressFrame.x = imageWidth /2 ;  
mcMainLoader.mcProgressFrame.y = imageHeight/ 2 + 20  
mcMainLoader.mcLoading.visible = true;  
mcMainLoader.mcProgress.visible = true ;  
mcMainLoader.mcProgressFrame.visible = true;  
}

function configDataLoaded(e:Event):void{  
configXML = new XML(e.target.data);  
//selectorX = configXML.child(“navbarSetup”)[0].attribute(“x”).toString();  
selectorY = configXML.child(“navbarSetup”)[0].attribute(“y”).toString();  
mcSliderMask.width = configXML.child(“imageSetup”).child(“image”).attribute(“width”).toString();  
imageWidth = configXML.child(“imageSetup”)[0].child(“image”)[0].attribute(“width”).toString();  
imageHeight = configXML.child(“imageSetup”)[0].child(“image”)[0].attribute(“height”).toString();  
imageToLoad = configXML.child(“feature”).length();  
imageToLoad += imageToLoad;  
mcMainLoader.mcCounterImage.y = imageToLoad;  
mcMainLoader.mcCounterThumb.y = mcMainLoader.mcCounterImage.y;  
resizeMainLoader();  
positionSelector();  
}  
function updateLoadingProgress():void{  
var loadedPC:Number ;  
if (imageToLoad \> 0 )  
loadedPC = (mcMainLoader.mcCounterThumb.x + mcMainLoader.mcCounterImage.x)/imageToLoad;  
else loadedPC = 0;  
mcMainLoader.mcProgress.scaleX = loadedPC;  
if (loadedPC == 1) {  
loadStatusTimer.stop();  
[//TransitionManager.start](https://TransitionManager.start)(mcMainLoader.mcLoading,{type:Fly, direction:Transition.OUT, duration:3, easing:Strong.easeOut,startPoint:8});  
TransitionManager.start(mcMainLoader,{type:Fade, direction:Transition.OUT, duration:2, easing:Strong.easeOut});  
}  
}  
function checkLoadStatus(e:TimerEvent):void{  
updateLoadingProgress();  
}  
var mcWelcomeImage:MovieClip = new MovieClip();  
mcWelcomeImage.name = “feature”;  
this.addChildAt(mcWelcomeImage,1);  
mcInfoPanel.visible = false;  
mcBalloon.visible = false;

//var xmlLoader2:URLLoader = new URLLoader();  
xmlLoader.addEventListener(Event.COMPLETE, onLoaded);

var xml:XML;  
function onLoaded(e:Event): void  
{

```
 xml = new XML(e.target.data);

```

var il:XMLList = xml.button.link;

//trace(il[0]);

//listen\_mc.addEventListener(MouseEvent.CLICK, clicklistennow);  
shop\_btn.addEventListener(MouseEvent.CLICK, clickhome);

//function clicklistennow(event:MouseEvent):void {  
// var clicklistennow:URLRequest = new URLRequest(il[0]);  
// navigateToURL(clicklistennow,"\_blank");  
//}  
//

function clickhome(event:MouseEvent):void {  
var clickhome:URLRequest = new URLRequest(il[0]);  
navigateToURL(clickhome,"\_self");  
}  
}
