Yeah, it seems the file system is pretty tricky. I can't load from it even though I have ...
this in my application: public function init():void { Security.allowDomain("*"); Security.loadPolicyFile("http://localhost/crossdomain.xml"); var request:URLRequest = new URLRequest(" http://localhost/crossdomain.xml"); var loader:URLLoader = new URLLoader(); loader.load(request); } this in my module (gets called by initialize) public function initMod(e:Event):void { Security.allowDomain("*"); } .. and this crossdomain.xml <?xml version="1.0"?> <!DOCTYPE cross-domain-policy SYSTEM " http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"> <cross-domain-policy> <allow-access-from domain="*" to-ports="*"/> </cross-domain-policy> .. still no luck. Relative url's can't be used, as I need to load modules through the gateway server. Of course, I can publish to and run my app from the server everytime I compile, but it slows down the development process. Best regards, Bjørn On 17 Apr 2007 05:54:37 -0700, Alex Harui <[EMAIL PROTECTED]> wrote:
I think it is because localhost is not the same domain as the file system, and you can't load modules across domains without import loading them. You might be better off loading via relative urls instead of absolute. ------------------------------ *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *bjorn - *Sent:* Tuesday, April 17, 2007 12:32 AM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] Problem with loading module -- mx.core::LayoutContainer could not be found. I don't have a crossdomain file, didn't think I needed one as it was all on localhost .. I get the problem when I run my project in Flex hitting ctrl-F11 since it will load my app directly (e.g. file:///C:/dev/FlexWorkspace/MyApp/build/MyApp-debug.html ) - while trying to load the module from a server (localhost). I don't see why it should be a problem though. As for the security error (here's another one for Google) - it's: "SWF is not a loadable module" ... The event: e = mx.events.ModuleEvent (@414ad61) bubbles = false bytesLoaded = 0 bytesTotal = 0 cancelable = false currentTarget = ModuleManager.as$20.ModuleInfoProxy (@3ecec81) errorText = "SWF is not a loadable module" eventPhase = 2 module = ModuleManager.as$20.ModuleInfoProxy (@3ecec81) target = ModuleManager.as$20.ModuleInfoProxy (@3ecec81) type = "error" Best regards, Bjørn On 16 Apr 2007 18:03:09 -0700, Robert Cadena <[EMAIL PROTECTED]> wrote: > > > Glad I could help. Just cause I'm curious: > - do you have a crossdomain at the root of your localhost server? > - is your parent app not loaded from the same domain (localhost)? > - you are doing this with the swf player, maybe on the browser or by > running the swf directly, not in apollo, right? > > you might want to add eventListeners to the moduleinfo just to see what > the exact security error is. Put a breakpoing on the function that > handles SecurityError and see what the error message is. > > best of luck. > > /r > http://www.searchcoders.com/flex/search/module > http://www.laflex.org/ - Los Angeles Flex Users Group > > bjorn - wrote: > > Robert, thanks for leading me onto the correct path :-) The problem > has to > > do with security. If I set the module url to a local path (c:\..) > > instead of > > localhost, I'm able to load it. > > > > Strange error message for security issues, don't you think? Well, now > it's > > soon on Google at the least. > > > > - Bjørn > > > > > > On 16 Apr 2007 10:10:50 -0700, Robert Cadena < [EMAIL PROTECTED]<robert%40searchcoders.com> > > > > wrote: > >> > >> Hi Bjorn, > >> > >> when you load the module, what ApplicationDomain are you passing to > the > >> the IModuleInfo? and how do you construct it if you are passing it as > a > >> param? > >> > >> /r > >> http://www.searchcoders.com/flex/search/module > >> http://www.laflex.org/ - Los Angeles Flex Users Group > >> > >> bjorn - wrote: > >> > Thanks for the tip .. I did try that already though, and it didn't > make > >> any > > -- ======================== http://www.juicability.com - flex blog http://www.43min.com - funny movies
-- ======================== http://www.juicability.com - flex blog http://www.43min.com - funny movies