Fixed it by providing ApplicationDomain.currentDomain on load()

...
            info = ModuleManager.getModule(moduleURL);
            if (info != null) {
                info.addEventListener(ModuleEvent.READY, onReady);  
                info.addEventListener(ModuleEvent.ERROR, onError);  
                info.load(ApplicationDomain.currentDomain);       
            }                   
...

Thanks a lot!

--- In flexcoders@yahoogroups.com, Alex Harui <aha...@...> wrote:
>
> Usually all webservice data classes need to be in the main applicationdomain.
> 
> Alex Harui
> Flex SDK Developer
> Adobe Systems Inc.<http://www.adobe.com/>
> Blog: http://blogs.adobe.com/aharui
> 
> From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On 
> Behalf Of poweribo
> Sent: Tuesday, August 18, 2009 12:09 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: Generated code not working when app is loaded as 
> module
> 
> 
> 
> anyone with idea?
> 
> --- In flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>, 
> "poweribo" <poweribo@> wrote:
> >
> > I used Flexbuilder to generated the proxy code for my webservices and
> > my app works perfectly as standalone swf file but when I load it as a 
> > module (loaded from another main swf file), it throws these kind of errors 
> > (see below). I tried declaring and instantiating the objects in question, 
> > also made sure are using public. I dont have custom utility function for 
> > calling getDefinitionByName() as well. but im getting the same errors. Does 
> > any one have a fix or workaround for this?
> >
> > ---------------------
> >
> > ReferenceError: Error #1065: Variable MyObject is not defined.
> > at global/flash.utils::getDefinitionByName()


Reply via email to