flex - Loading Swf with bytearray in AIR -


we have requirement air application loads flex generated swf inturn loads flash generated swf using swfloader. not working desired. gives following error: securityerror: error #3226: cannot import swf file when loadercontext.allowcodeimport false.

this our air application.

<?xml version="1.0" encoding="utf-8"?> <mx:windowedapplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationcomplete="initapp()"> <mx:script> <![cdata[  import mx.controls.swfloader;  [embed(source="flexloadingflash.swf")] public var flexmovie:class;  private function initapp():void {     // first convert swf movieclip     var movieclip:movieclip = new flexmovie();      // bytearray movieclip     var bytearray:bytearray = movieclip.movieclipdata;       var swfloader:swfloader = new swfloader();      // load bytearray swfloader     swfloader.source = bytearray;      swfloader.maintainaspectratio = false;      swfloader.percentheight = vbox.height;     swfloader.percentwidth = vbox.width;     swfloader.invalidatedisplaylist();     swfloader.invalidatesize();      // add swfloader container     vbox.addchild(swfloader);  }   ]]>  </mx:script>  <mx:vbox id="vbox" width="100%" height="100%" verticalcenter="0" horizontalcenter="0" cacheasbitmap="true" >  </mx:vbox>  </mx:windowedapplication> 

please let me know how can fix issue.

use loader.loadbytes() load swf. create instance of loadercontext. loadbytes method takes loadercontext instance parameter. set allowcodeimport property of loadercontext instance true , should work


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -