I developed this web application for a client of mine. It was running fine on a server but now they want an offline for presentation purposes.
So they asked me to do some changes (load local pictures etc…) and deploy an offline version.
So while doing that I discovered the following error:
This error occurs when I tried to open the HTML file that embeds the SWF in my browser.
Doing what it says and changing the global security settings didn’t help me. Once you click OK the browser opens and flash player displays the following error:
SecurityError: Error #2028: Local-with-filesystem SWF file file:///C:/Users/Dan/Desktop/bin-release/MyFlashApplication.swf cannot access Internet URL http://fpdownload.adobe.com/pub/swz/flex/126.96.36.19959/osmf_flex.188.8.131.5295.swz. at flash.net::URLStream/load() at flash.net::URLLoader/load() at mx.core::CrossDomainRSLItem/load() at mx.core::RSLListLoader/loadNext() at mx.core::RSLListLoader/load() at mx.preloaders::Preloader/initialize() at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::initialize() at mx.managers::SystemManager/initHandler()
So from what I’ve learned the SWF file tries to load parts of the Flex Framework dynamically from the Adobe server. Which in general is a good thing. But in this case it is not as we are trying to deploy a complete local version in case we can’t depend on a working internet connection.
Solution 1 — Setting compiler arguments
The first solution I tried is to set the following compiler arguments
in the Flash Builder Compiler Settings.
For an older project of mine this was everything I needed to do. But with this project the same error still came up after opening the HTML file locally in my browser.
Solution 2 — Merging the Framework into the code
To finally fix this issue I had to merge the Framework into my code so the Flash Player doesn’t try to load it at runtime. Remember how I mentioned earlier that’s what the Flash Player is trying to do. But since we can’t depend on a working internet connection we have to include all the necessary framework code into our project at compile time.
To accomplish this you only need to do the following steps:
Go to your Project Properties -> Flex Build Path -> Framework linkage: -> Merged into code
That should do the trick! Compile your application again and start it from anywhere on your computer, send it to friends or clients and will it run seamlessly on any computer.
I hope this helped anyone out there. I had to look for 30 min around various pages that came up on Google.
If it took you less time to find this site or if this helped you out please leave me a comment.
Thanks for reading…