I’m trying to load some binary data from server like this
var urlRequest:URLRequest = new URLRequest("http://localhost/test.php");
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
loader.load(urlRequest);
But it always report an error:
Loader Error #2124: Loaded file is an unknown type
My binary data is custom data but not swf/image file. Does flash not support to load such data? Or I should use some other method?
You needs to use
URLLoaderinstead ofLoader. BecauseLoaderobject is useful for load swfs and images only . andURLLoaderonly for store binary data or text or binary encoded data.