flex:加载本地flash文件 [英] flex: loading local flash file
问题描述
i已经嵌入了2个mxml组件感谢你们,
现在在屏幕中心,当我尝试使用SWFLoader对象
i载入一个swf文件时,得到以下错误:
错误#2044:未处理的securityError :. text =错误#2140:安全沙箱违规:file:/// C:/Users/ufk/Documents/Flex%20Builder%203/GamePage/bin-debug/GamePage.swf无法加载file:/// C:/ Users /ufk/Documents/Flex%20Builder%203/GamePage/bin-debug/crazy_counting.swf。本地文件系统和本地网络SWF文件无法加载对方。
code:
<?xml version =1.0encoding =utf-8?>
< mx:应用程序xmlns:mx =http://www.adobe.com/2006/mxmllayout =absolutebackgroundGradientColors =[0xFFFFFF,0xAAAAAA]xmlns:local =*>
< local:AchievementsVBox x =0y =0height =531/>
< mx:SWFLoader id =game_swfsource =crazy_counting.swfx =198y =0width =721height =531/> code $
< local:LiveScoringSystemVBox x =918y =0height =531width =218/>
> Project / Properties / Flex编译器/其他编译器参数并确保两个SWF都是用 -use-network = false
标志编译的。如果其中一个SWF可以与网络通话,则无法加载本地SWF(反之亦然)。
i'm pretty new to flex 3 but it's really cool so far.
i have embedded 2 mxml components thank to you guys,
now in the center of the screen when i try to load an swf file using the SWFLoader object
i get the following error:
Error #2044: Unhandled securityError:. text=Error #2140: Security sandbox violation: file:///C:/Users/ufk/Documents/Flex%20Builder%203/GamePage/bin-debug/GamePage.swf cannot load file:///C:/Users/ufk/Documents/Flex%20Builder%203/GamePage/bin-debug/crazy_counting.swf. Local-with-filesystem and local-with-networking SWF files cannot load each other.
code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundGradientColors="[0xFFFFFF,0xAAAAAA]" xmlns:local="*">
<local:AchievementsVBox x="0" y="0" height="531"/>
<mx:SWFLoader id="game_swf" source="crazy_counting.swf" x="198" y="0" width="721" height="531"/>
<local:LiveScoringSystemVBox x="918" y="0" height="531" width="218"/>
</mx:Application>
Go to Project/Properties/Flex Compiler/Additional compiler arguments
and make sure that both SWF's are compiled with -use-network=false
flag. If one of the SWF's can talk to network, you cannot load a local SWF into it (the reverse is also true).
这篇关于flex:加载本地flash文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!