Error Message Help

Hi All

New problem, when i try to run an app, i get this error message

An ActionScript error has occurred:

SecurityError: Error #2148: SWF file file:///home/julian/IdeaProjects/Flextest/out/production/Flextest/HelloWorld.swf cannot access local resource file:///home/julian/IdeaProjects/Flextest/out/production/Flextest/textLayout_1.1.0.604.swf. Only local-with-filesystem and trusted local SWF files may access local resources.

Any suggestions please ?

many thanks

Comment actions Permalink

<Flex SDK>/frameworks/flex-config.xml is a base compiler configuration file and is used in your compilation. It contains reference to textLayout.swc as an runtime RSL library:


These lines mean that at runtime Flash Player tries to download required RSL by url, and if fails - looks for local file textLayout_1.1.0.604.swz in the same folder where main SWF located. So there are several ways to get through the problem:
- Make sure that is reachable for Flash Player
- Do not use runtime shared libraries (set <static-link-runtime-shared-libraries> to true in <Flex SDK>/frameworks/flex-config.xml or write -static-link-runtime-shared-libraries=true in Additional compiler Optons at Flex Compiler Settings tab)
- Copy textLayout_1.1.0.604.swz from <Flex SDK>/frameworks/rsls/ to /home/julian/IdeaProjects/Flextest/out/production/Flextest/ and check 'Place SWF file in a local trusted sandbox' at Flex Run Configuration dialog.

Comment actions Permalink

Flex 4 uses framework RSLs by default so any new Flex 4 project you create in IDEA is going to throw this error. Wouldn't it make more sense for the IDEA builder to copy the framework RSLs into the out/production folder at build-time? (That's what Flash Builder does.)  If so, can we create a ticket in JIRA for this enhancement?

Comment actions Permalink

'Debug' and 'Release' builds have a lot of differences in FB. As far as I know for debug purposes it always adds 'bin-debug' folder to trusted locations and always links RSLs statically (so copying SWZ files doesn't matter in fact). In IDEA you have full control on what IDEA is doing. Debug is turned on/off at File | Settings | Compiler | Flex Compiler. Trust or not - at Run Configuration dialog. Other settings are set at Project Structure dialog. Which workflow is the best - it is a subject for discussion.
Yes, you are right, Flex 4 uses framework RSLs by default. And by default RSLs are downloaded from standard location, so people do not havee such errors. RSLs fail to load if you use non-standard main class (not derived from spark.components.Application or mx.core.Application) and forgot to set [Frame] metadata or set incorrect factoryClass. Compiler gives a warning in this case. Default is [Frame(factoryClass="mx.managers.SystemManager")]

Comment actions Permalink

1) Flash Builder uses dynamic linking (i.e. it uses "signed" framework RSLs) by default for Flex 4 projects (unless you configure the IDE to use static linking).
2) RSLs are only "downloaded from a standard location" if is reachable. If is not reachable the framework expects the RSLs to be alongside the app. That's why Flash Builder deploys them to the equivalent of out folder (by default bin-debug for a debug build and bin-release for a release build), just in case.


Please sign in to leave a comment.