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

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....

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

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

function completeHandler1(event:Event):void {
	var loader:URLLoader = URLLoader(;
	var viewswithusertype:Array=listData.split("$");
	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);

...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). 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?

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…