Apache – flex: loading local flash file

apache-flexflash

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>

Best Answer

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).

Related Topic