Hi All,
I was facing Stage access issue when was trying to load Gigya into an AIR application cause of Flash Player Security policies.
SecurityError: Error #2070: Security sandbox violation: caller http://cdn.gigya.com/wildfire/swf/wildfireInAS3.swf?ModuleID=cfg cannot access Stage owned by app:/dmlSetup.swf.
at flash.display::Stage/get stageWidth()
at WildfireInAS3_fla::MainTimeline/WhenAddedToStage()
at WildfireInAS3_fla::MainTimeline/onEnterFrameHandler()
Then I've changed Loader to URLLoader with binary data format in generated code from Gigya setup:
var urlLoader : URLLoader = new URLLoader();
urlLoader.dataFormat = URLLoaderDataFormat.BINARY;
urlLoader.addEventListener( Event.COMPLETE, onGigyaLoaded );
urlLoader.load( new URLRequest( 'http://cdn.gigya.com/wildfire/swf/wildfireInAS3.swf?ModuleID=cfg' ) );
Added onGigyaLoaded handler:
private function onGigyaLoaded( e : Event ) : void {
var loader : Loader = new Loader();
var context : LoaderContext = new LoaderContext();
context.allowLoadBytesCodeExecution = true;
loader.contentLoaderInfo.addEventListener( Event.COMPLETE, onAppExecuted );
loader.loadBytes( ByteArray( ( e.currentTarget as URLLoader ).data ), context );
}
private function onAppExecuted( e : Event ) : void {
var uic : UIComponent = new UIComponent();
wfLoaderBox.addChild(uic);
uic.addChild( LoaderInfo( e.target ).loader );
}
Stage problem had gone, but another problem did arise.
SecurityError: Error #3207: Application-sandbox content cannot access this feature.
at flash.system::Security$/allowDomain()
at WildfireInAS3_fla::MainTimeline/frame1()
Can anyone say something how to get AIR application working with Gigya?
RIA development, Flash/Flex/AIR development
www.exairo.com