# Problem with passing relative url in Flash (or) Absolute path v/s relative path

**URL:** <https://forum.kirupa.com/t/problem-with-passing-relative-url-in-flash-or-absolute-path-v-s-relative-path/291799>\
**Category:** Uncategorized\
**Created:** [July 6, 2009, 4:38am UTC](https://forum.kirupa.com/t/problem-with-passing-relative-url-in-flash-or-absolute-path-v-s-relative-path/291799 "2009-07-06T04:38:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SrihariCh](https://avatars.discourse-cdn.com/v4/letter/s/f1d935/32.png) [@SrihariCh](https://forum.kirupa.com/u/SrihariCh)\
**Post date:** [July 6, 2009, 4:38am UTC](https://forum.kirupa.com/t/problem-with-passing-relative-url-in-flash-or-absolute-path-v-s-relative-path/291799/1 "2009-07-06T04:38:15Z")

</div>

Hi all,  
I am new to Flash and ActionScript 3.0 environment. I don’t have any knowledge in depth with Flash and ActionScript 3.0.  
I am using the flash(.swf file) in my Java application. Now, this .swf file is to be placed in the server system. While I am working with these, I faced an error.

```
   Here, my issue/problem(s) starts....

```

**1.)**  
With the help of URLRequest & URLLoader classes, I am loading a jpg file dynamically onto the stage using the following code:

```auto

...bla ...bla
var request:URLRequest = new URLRequest("http://localhost:8888/getviews");
//var request:URLRequest = new URLRequest("http://www.mymdworld.com:8082/getviews");
var urlLoader:URLLoader = new URLLoader();
urlLoader.dataFormat = URLLoaderDataFormat.TEXT;
urlLoader.addEventListener(Event.COMPLETE, completeHandler1);
urlLoader.load(request);

function completeHandler1(event:Event):void {
	var loader:URLLoader = URLLoader(event.target);
	var listData:String=loader.data;
	var viewswithusertype:Array=listData.split("$");
	usertype=viewswithusertype[0];
	var views:String=viewswithusertype[1];
	var users:Array = views.split(".");
	trace("users.length ="+users.length);
	for (var t=0; t<users.length; t++) {
		trace("in for loop");
		var itemname:String=users[t];
		var itemslist:Array=itemname.split(",");
		trace("itemslist: "+itemslist);
		comboBox_mc.addItem({label:itemslist[1],data:itemslist[0]});
	}
}

...bla ..bla

//Code for loading the specific image when we click on Combo-box is added here.
... ... ...

```

So, in the above code, in the first statement, I am passing the absolute path of the servlet as a parameter(viz., **[http://localhost:8888/getviews](http://localhost:8888/getviews)**). It works fine in my localhost system.

What should I do if I want to open (or) execute the same url anywhere[i.e., both locally and remotedly] from Flash?

**2.)**  
Also,Can we pass a url\_String to URLRequest & URLLoader as a **relativepath** instead of as an **absolute\_path** [same as in the above case which **you can see in the first line of the code above**].  
**If so, How we can achieve this?**

Please, spend few minutes of your valuable time by replying solution or atleast a hint to my problem(s).  
I will be waiting for your replies…

Thanks in advance…  
Srihari.Ch
