Any help with this would be greatly appreciated. We have the server where the
file is housed defined in our crossdomain.xml file:
<allow-access-from domain="www.server.com" />
crop1.as:239 is the following:
var bmd:BitmapData = Bitmap(event.currentTarget.content).bitmapData;
The MXML:
<mx:Image source="{Stage}" initialize="imageInit()"
loaderContext="{loaderContext}" />
Other pertinent code:
[Bindable]
public var loaderContext : LoaderContext;
[Bindable]
// The input image object.
public var Stage:Image = new Image();
[Bindable]
public var picName:String; // input image file.
private function imageInit() : void
{
loaderContext = new LoaderContext();
loaderContext.checkPolicyFile = true;
}
Stage.load(picName);
// note, "picName" is a flashvar passed in as:
http://www.server.com/img.jpg
The error:
SecurityError: Error #2122: Security sandbox violation: Loader.content:
http://localhost:8500/ImageCrop2/bin...ImageCrop2.swf cannot access
http://www.tastymojo.com/LouisvilleM...81014181345359
686.jpg. A policy file is required, but the checkPolicyFile flag was not set
when this media was loaded.
at flash.display::Loader/get content()
at mx.controls::SWFLoader/get
content()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\ controls\SWFLoader.a
s:503]
at
ImageCrop2/completedImg()[C:\ColdFusion8\wwwroot\ImageCrop2\src\crop1.as:239]
at flash.events::EventDispatcher/dispatchEventFunctio n()
at flash.events::EventDispatcher/dispatchEvent()
at
mx.core::UIComponent/dispatchEvent()[E:\dev\3.0.x\frameworks\projects\framework\
src\mx\core\UIComponent.as:9051]
at
mx.controls::SWFLoader/http://www.adobe.com/2006/f lex/mx/internal::contentLoader
Info_completeEventHandler()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\ co
ntrols\SWFLoader.as:1671]
at
mx.controls::Image/http://www.adobe.com/2006/flex/ mx/internal::contentLoaderInfo
_completeEventHandler()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\ contro
ls\Image.as:337]