How to check for a file on my flash server
This is the code I'm trying to use to detect if a file is on my flash server. The file is a recorded stream from a users webcam. What I am trying to do is create a pause to prevent the user from leaving the page until the file has completed the process of uploading and being encoded.
The code:
import flash.net.URLLoader
var urlRequest:URLRequest = new URLRequest("rmtp/xxx.xxx.xxx/direct/file.name");
var urlLoader:URLLoader = new URLLoader();
urlLoader.dataFormat = URLLoaderDataFormat.BINARY;
urlLoader.addEventListener(Event.COMPLETE, urlLoader_complete);
urlLoader.addEventListener(IOErrorEvent.IO_ERROR, urlLoader_error);
urlLoader.load(urlRequest);
function urlLoader_complete(evt:Event):void {
trace("file found");
}
function urlLoader_error(evt:IOErrorEvent):void {
trace("file obviously not found");
}
The code works fine if the server is installed in the site public directory, I change rtmp to http and so on, but not when installed in the root. I'd prefer not to change from the root for security and logistic reasons. Any help or code suggestions would be appreciated as I've think I've exausted my google options.
