Hi everyone,
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/4.0.0.14159/osmf_flex.4.0.0.13495.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
-use-network=false
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…




Hi man=) It’s help me a lot because i was disappointed when look at bin-debug folder compiling simple app in 4.0 sdks.
A lot of new files — and i didn’t know from where they exist and for what .
If says that you searched and found so quick result for your own problem.
Can you give some reference — for what is those files exist.
Hi Vitalik,
I don’t quite understand what your question is. The “new” SDK just deploys a few files that haven’t been there before. It’s just the the framework the application needs in order to run properly. In my post I am just describing some ways on how to deploy these files. So in case you want to deploy a local version (that is not an AIR project) you might want to go for one of my suggested options.
Let me know what exactly you want to achieve
Cheers,
Dan
can i open swf file with flash pro?
Hi, I created all my files with Flex Builder 3 or Flash Builder 4. I wouldn’t know if it works with Flash Pro.
Just go ahead and try but I can’t guarantee anything. Cheers,
Dan
I can just say exactly what a relief to discover someone that actually knows what theyre discussing on the web. You actually understand how to bring a problem to light making it important. Lots more people should check this out and appreciate this side of the story. I cant believe youre not very popular since you definitely have the gift.
Thanks mate! I’m glad I could help you out. Enjoy your coding…
Thanks for the pointer. I appreciate the help. Cheers from Indiana, USA.
Yes very helpful, thanks!