Filereference work in localhost but not in server!

My file reference function is not working when i upload my swf into my server. I tried in localhost it works. I tried publishing in HTML it works. I wonder what’s wrong.

Here is the screen shot of my code.

The file reference is suppose to allow the user to save the “var ba” to their local hardisk. Thanks in advance.

Edit : i found that my preloader is the main cause. Any code i should put in my preloader so the file reference will works?

this is the preloader code

import flash.net.FileReference;


var loader:Loader = new Loader();//declaring new loader variable
 // adding loader into the stage
//loader's funtion.
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loading);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, done);

loader.load(new URLRequest("2DavatarGame2.swf"));//loader loading the 2d Avatar game
this.addChild(loader);

//doing the progress bar.
function loading(e:ProgressEvent){
var perc:Number = e.bytesLoaded / e.bytesTotal;
  percent.text = Math.ceil(perc*100).toString()+"%";
  loaderBar.scaleX=perc;
}

//removing unneccesary item from the stage.
function done(e:Event){
    removeChild(percent);
    removeChild(loaderBar);
    removeChild(_title);
    removeChild(loadingclip);

}