View Full Version : External SWFs load with Flex Builder
alexmmn
December 9th, 2007, 11:51 PM
I am using Flex Builder 3 Beta for AS3 development.
When I load an external SWF via a Loader object and generate preview (run) my application with Flex Builder, it does not load an external SWF on the page generated. Yet, when I preview it in a stand-alone Flash Player or via a localhost, it works just fine.
Anyone experienced this issue?
I know it is something to do with the local environment security model. I can understand and appreciate that. However, how do I get control over it in Flex? I cannot add compiler options to Actionscript 3 compiler in Flex unless I'm creating a Flex application. Any help is greatly appreciated. Thanks.
raal
December 10th, 2007, 03:11 AM
Do you catch exceptions? If there is a security issue (IE, you compile / test on disk and the file you want to load is located on a webserver) you should be able to catch the exception and get a detailed error.
If there are no security issues then there might be something wrong with the path to the file. For example, if this is your directory structure
/code/project/ <-- this is where the source is and the compilation happens
/code/project/release/ <-- this is the directory where you publish
/code/project/asset/ <-- this is the location of the external .swf
if you try to load "../asset/myasset.swf" this will work with a published file but not from the compiler.
raal
alexmmn
December 10th, 2007, 10:05 AM
Do you catch exceptions? If there is a security issue (IE, you compile / test on disk and the file you want to load is located on a webserver) you should be able to catch the exception and get a detailed error.
If there are no security issues then there might be something wrong with the path to the file. For example, if this is your directory structure
/code/project/ <-- this is where the source is and the compilation happens
/code/project/release/ <-- this is the directory where you publish
/code/project/asset/ <-- this is the location of the external .swf
if you try to load "../asset/myasset.swf" this will work with a published file but not from the compiler.
raal
I do catch exception as in "assets.contentLoaderInfo.addEventListener(IOErrorE vent.IO_ERROR, ioErrorListener);"
and do a trace of an error. The assets.swf path is the same as the main swf of the application so the URLRequest is URLRequest("assets.swf") So this is not a path issue.
raal
December 10th, 2007, 01:27 PM
Then what's the error?
raal
alexmmn
December 11th, 2007, 09:41 AM
Then what's the error?
raal
sandbox security violation.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.