I saw this on MySpace but have increasingly seen it more and more lately on numerous sites.

Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: http://lads.myspace.com/upload/uploader.swf cannot load data from http://upload.myspace.com/ImageUpload/Services/Token/Token.ashx?&v=1.5&c=3C31853C-6021-9542-604F-A664AA8B1063.
at com.myspace.components::UploadFiles/getToken()
at com.myspace.components::UploadFiles/upload()
at com.myspace.components::UploadFiles/___UploadFiles_Panel1_show()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()
at mx.core::UIComponent/setVisible()
at mx.core::UIComponent/set visible()
at mx.containers::ViewStack/updateDisplayList()
at mx.core::UIComponent/validateDisplayList()
at mx.core::Container/validateDisplayList()
at mx.managers::LayoutManager/validateDisplayList()
at mx.managers::LayoutManager/doPhasedInstantiation()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/callLaterDispatcher2()
at mx.core::UIComponent/callLaterDispatcher()

That is nothing but a crossdomain.xml security error. You’d think this would have been tested but oh well.

Instead of just pointing out someone’s fault, my intent here is to show you how to keep your visitors from seeing this error.

Since this happened when trying to upload a new image they are probably using FileReference. So, here is what they should’ve done:

var ref:FileReference = …
ref.addEventListener(SecurityErrorEvent.SECURITY_ERROR, handleError);
….

private function handleError(event:SecurityErrorEvent):void{
//playing catch
}

Another one that helps is IOErrorEvent.IO_ERROR. Those are the two you should always have when loading files or calling services even if you do just catch them and do nothing about it.

Hope this helps someone.