flex:加载本地flash文件 [英] flex: loading local flash file

查看:23
本文介绍了flex:加载本地flash文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 flex 3 还很陌生,但到目前为止它真的很酷.感谢你们,我已经嵌入了 2 个 mxml 组件,当我尝试使用 SWFLoader 对象加载 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:

错误 #2044:未处理的安全错误:.文本=错误 #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 文件彼此.

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.

代码:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundGradientColors="[0xFFFFFF,0xAAAAAA]" xmlns:local="*">

<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:应用程序>

推荐答案

转到 Project/Properties/Flex Compiler/Additional compiler arguments 并确保使用 -use 编译两个 SWF-network=false 标志.如果其中一个 SWF 可以与网络通信,则您无法将本地 SWF 加载到其中(反之亦然).

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆