# Passing variable to URLRequest

**URL:** <https://forum.kirupa.com/t/passing-variable-to-urlrequest/284729>\
**Category:** Uncategorized\
**Created:** [March 23, 2009, 3:33am UTC](https://forum.kirupa.com/t/passing-variable-to-urlrequest/284729 "2009-03-23T03:33:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kenmarold](https://avatars.discourse-cdn.com/v4/letter/k/5f8ce5/32.png) [@kenmarold](https://forum.kirupa.com/u/kenmarold)\
**Post date:** [March 23, 2009, 3:33am UTC](https://forum.kirupa.com/t/passing-variable-to-urlrequest/284729/1 "2009-03-23T03:33:19Z")

</div>

Could someone help me with this? I’m unclear as to why this bit of code won’t work and my eyeballs are about ready to pop ![](http://forum.kirupa.com/uploads/kirupa/798/c985a958819d8917.gif) Is it not possible to assign a URL to a variable and then pass that variable back to the URLRequest? I’m getting two errors:

1151: A conflict exists with definition movieURL in namespace internal.  
Warning: 3596: Duplicate variable definition.

I’ve attached the code below, any help would be GREATLY appreciated.

var movieURL:String = new String();  
var movieURL = “flash/pages/web/projects/webUNM.swf”;

var movieLoader:Loader=new Loader();  
stage.addChild(movieLoader);  
movieLoader.x=225; movieLoader.y=20;

var listStyleNorm:TextFormat = new TextFormat();  
listStyleNorm.color = 0x000000;   
var listStyleOver:TextFormat = new TextFormat();  
listStyleOver.color = 0xffffff;

function menuButton(mc:MovieClip):void {  
mc.addEventListener(MouseEvent.MOUSE\_OVER, menuOver);  
mc.addEventListener(MouseEvent.MOUSE\_OUT, menuOut);  
mc.addEventListener(MouseEvent.MOUSE\_UP, menuLoad);  
};  
function menuOver(e:MouseEvent):void {  
e.currentTarget.t.setTextFormat(listStyleOver);  
};  
function menuOut(e:MouseEvent):void {  
e.currentTarget.t.setTextFormat(listStyleNorm);   
};  
function menuLoad(e:MouseEvent):void {  
fadeMovie=new Tween(movieLoader, “alpha”, Regular.easeIn, 0, 1, 1, true);  
var movieReq:URLRequest=new URLRequest(movieURL);  
movieLoader.load(movieReq);  
stage.addChild(movieLoader);   
};  
// Set up buttons  
menuButton(webMenu\_mc.projUNM\_mc);
