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


4 comments

<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:

    <runtime-shared-library-path>
        <path-element>libs/textLayout.swc</path-element>
        <rsl-url>http://fpdownload.adobe.com/pub/swz/tlf/1.1.0.604/textLayout_1.1.0.604.swz</rsl-url>
        <policy-file-url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</policy-file-url>
        <rsl-url>textLayout_1.1.0.604.swz</rsl-url>
        <policy-file-url></policy-file-url>
    </runtime-shared-library-path>

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 http://fpdownload.adobe.com/pub/swz/tlf/1.1.0.604/textLayout_1.1.0.604.swz 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.

0

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?

0

'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")]

0

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 fpdownload.adobe.com is reachable. If fpdownload.adobe.com 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.

0

Please sign in to leave a comment.