当我尝试使用FlexUnit4和IntelliJ运行测试时,我收到此错误:
SecurityError: Error #2148: SWF file file:///C|/Users/LIC/Projects/ProgramJef/out/production/Flex%2DClient%2DTests/%5Fflexunit.swf cannot access local resource file:///C|/Users/LIC/Projects/ProgramJef/out/production/Flex%2DClient%2DTests/textLayout_1.1.0.604.swf. Only local-with-filesystem and trusted local SWF files may access local resources.
at flash.net::URLStream/load()
at flash.net::URLLoader/load()
at mx.core::CrossDomainRSLItem/load()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\CrossDomainRSLItem.as:240]
at mx.core::RSLListLoader/loadNext()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\RSLListLoader.as:184]
at mx.core::RSLListLoader/load()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\RSLListLoader.as:156]
at mx.preloaders::Preloader/initialize()[E:\dev\4.x\frameworks\projects\framework\src\mx\preloaders\Preloader.as:279]
at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::initialize()[E:\dev\4.x\frameworks\projects\framework\src\mx\managers\SystemManager.as:1925]
at mx.managers::SystemManager/initHandler()[E:\dev\4.x\frameworks\projects\framework\src\mx\managers\SystemManager.as:2419]
我真的不知道这里有什么问题,我在网上找不到任何东西。即使在IntelliJ和FlexUnit4上也找不到......
答案 0 :(得分:2)
您必须允许生成的SWF访问您的文件系统。在文件中设置Flashplayer信任设置。在Linux上,此文件必须在
中~/.macromedia/Flash_Player/#Security/FlashPlayerTrust/
(对于Windows,某处有类似的路径)并创建一个列出项目输出路径的文件,例如
/dev/myproject/target
/dev/anotherproject/target
如果'target'是我们的输出文件夹。
答案 1 :(得分:0)