How to run an external SWF inside a Flex Application?

后端 未结 5 1775
慢半拍i
慢半拍i 2021-02-03 15:18

EDIT: Due to the answer I change the code posted. I\'ve added the Security.allowDomain(\"*\") line and that line throws me an error. So, ho

5条回答
  •  你的背包
    2021-02-03 15:45

    One thing you may want to consider is that if you are trying to run a SWF from inside your application directory in AIR, AIR restricts execution of files. If you copy the file to a temp file and the run it (along with allowLoadBytesCodeExecution set to true) then it works.

    var file:File = File.applicationDirectory.resolvePath("myFile.swf");
    this.tmpFile = File.createTempDirectory().resolvePath("myFile.swf");
    file.copyTo(this.tmpFile);
    
    imagePreview.loaderContext = lc;
    imagePreview.source = tmpFile.url;
    

提交回复
热议问题