as3 to php file upload

Hello i have been wandering the internet for several days and can’t find an answer to my file uploader nightmare, i just want to upload a file from flash via php, i have been using the FileReference class but as soon as i try to upload it nothing happens or at least it tells me its complete in super quick time but nothing has been uploaded and there has been no POST request fired i have checked my directorie paths and they are fine but no joy.

Any help to solve this is hugely appreciated i proper want to get this to work, would be cool to finally get php working with flash for the first time.

below is my code to help see:

import flash.system.Security;


var _uploadUrl:URLRequest;
var _fileName:String;
var _fileRef:FileReference;

_uploadUrl = new URLRequest();
_uploadUrl.url = "";
_fileRef = new FileReference();

upload_btn.buttonMode = true;
browse_btn.buttonMode = true;

//config listeners
_fileRef.addEventListener(ProgressEvent.PROGRESS, progressHandler);
_fileRef.addEventListener(Event.COMPLETE, completeHandler);
_fileRef.addEventListener(Event.SELECT, selectHandler);
_fileRef.addEventListener(IOErrorEvent.IO_ERROR, IOHandler);
browse_btn.addEventListener(MouseEvent.MOUSE_DOWN, browse);
upload_btn.addEventListener(MouseEvent.MOUSE_DOWN, upload);

function progressHandler(e:ProgressEvent):void{
    file_txt.text = "progressHandler: name=" + + " bytesLoaded=" + e.bytesLoaded + " bytesTotal=" + e.bytesTotal;

function completeHandler(e:Event):void{
    //file_txt.text = "complete = "+e;

function selectHandler(e:Event):void{
    _fileRef = FileReference(;
    file_txt.text = FileReference(;

function IOHandler(ie:IOErrorEvent):void{
    file_txt.text = "IO Error = "+ie;

function browse(me:MouseEvent):void{

function upload(me:MouseEvent):void{