Thanks...I think that clears it up.

So, if I am understanding correctly, for consistency, I should call .load(new 
ApplicationDomain(ApplicationDomain.currentDomain)); for module loads inside of 
modules, and from inside the main application as well (since apparently that is 
the same thing that happens if you call .load(); from the application anyway).

And once I get everything migrated to 4.5+, I don't need to worry about 
specifying ApplicationDomain at all?

Freundliche Grüße / Best regards,
Bill Franklin
Computer Integrated Mfg.

[cid:image001.gif@01CD1707.9A91AAA0]
Bayer CropScience LP
8400 Hawthorne Road, Room 2447
Kansas City, MO 64120
Tel: +1 816 242 2148
Fax: +1 816 242 2047
E-mail: bill.frank...@bayer.com
Web: http://www.bayercropscience.com

Vorstand: Sandra E. Peterson, Vorsitzende   |  Lykele van der Broek, Achim 
Noack, Rüdiger Scheitza, Michael A. Schulz
Vorsitzender des Aufsichtsrats: Werner Baumann
Sitz der Gesellschaft: Monheim am Rhein   |   Eintragung: Amtsgericht 
Düsseldorf, HRB 46985

From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf 
Of Alex Harui
Sent: Tuesday, April 10, 2012 10:28 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Nested Modules: "No destination with id null is 
registered with any service"



Actually, you have four commonly used options whenever a parameter or property 
is of type ApplicationDomain:

    null
    new ApplicationDomain()
    ApplicationDomain.currentDomain
    new ApplicationDomain(ApplicationDomain.currentDomain)


New ApplicaitonDomain() will never work for modules.  It is used in 
MarshallPlan configurations.

ApplicationDomain.currentDomain is used to load classes that you do not wish to 
unload.  Once you mix classes from a loaded SWF into the current 
ApplicationDomain, they cannot be unloaded.  RSLs use this option, and 
StyleModules occasionally use this option.  Shared Code modules may use this 
option.  It depends on whether the classes in the loaded SWF should remain 
encapsulated or not.

New ApplicationDomain(ApplicationDomain.currentDomain) is usually what happens 
when you use null.  It creates a child ApplicationDomain which encapsulates the 
classes which allows them to later be unloaded.

The problem is that the value of ApplicationDomain.currentDomain changes based 
on the SWF that owns the code.  Because ModuleManager is almost always in the 
main SWF, the null value, which implies "new 
ApplicationDomain(ApplicationDomain.currentDomain) always creates a child 
ApplicationDomain of the main SWF, even though you might have called it from a 
module.  This is resolved in Flex 4.5 with fancier code, but you said you were 
using Flex 3.

So, you are probably loading all modules into the main SWF's applicationDomain 
which is probably not really what you want if you care about unloading.  You've 
essentially converted that module into an RSL, which is why it works.  You 
probably want to use "new ApplicationDomain(ApplicationDomain.currentDomain)" 
which is not the same as null when called from a module.

Tricky, isn't it?
-Alex

On 4/10/12 7:05 AM, "Bill Franklin" <bill.frank...@bayer.com> wrote:





Thanks Alex,

Is there a time when you wouldn't want to put ApplicationDomain.currentDomain 
in the IModuleInfo.load call?


Freundliche Grüße / Best regards,
Bill Franklin
Computer Integrated Mfg.

[cid:image001.gif@01CD1707.9A91AAA0]
Bayer CropScience LP
8400 Hawthorne Road, Room 2447
Kansas City, MO 64120
Tel: +1 816 242 2148
Fax: +1 816 242 2047
E-mail: bill.frank...@bayer.com
Web: http://www.bayercropscience.com

Vorstand: Sandra E. Peterson, Vorsitzende   |  Lykele van der Broek, Achim 
Noack, Rüdiger Scheitza, Michael A. Schulz
Vorsitzender des Aufsichtsrats: Werner Baumann
Sitz der Gesellschaft: Monheim am Rhein   |   Eintragung: Amtsgericht 
Düsseldorf, HRB 46985


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf 
Of Alex Harui
Sent: Tuesday, April 10, 2012 1:44 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Nested Modules: "No destination with id null is 
registered with any service"



Make sure you have loaded the modules correctly.  You have to specify the 
applicationDomain of the nested module otherwise it will become a sibling.


On 4/9/12 2:35 PM, "BillF" <bill.frank...@bayer.com> wrote:






Flex SDK v3.6

Okay, I have a module that is called from an application.  That module calls 
another module.  Trying to run any RemoteObjects from the nested module is 
failing, resulting in the following error:

TypeError: Error #1034: Type Coercion failed: cannot convert Object@d3dcad9 to 
mx.messaging.messages.IMessage.

Viewing the RemoteObject call in CharlesProxy gives the error:

"No destination with id null is registered with any service"

The exact same RemoteObject call works correctly in the parent module, but not 
in the child module.

Any ideas?





--
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui


________________________________________________________________________
The information contained in this e-mail is for the exclusive use of the 
intended recipient(s) and may be confidential, proprietary, and/or 
legally privileged.  Inadvertent disclosure of this message does not 
constitute a waiver of any privilege.  If you receive this message in 
error, please do not directly or indirectly use, print, copy, forward,
or disclose any part of this message.  Please also delete this e-mail 
and all copies and notify the sender.  Thank you. 

For alternate languages please go to http://bayerdisclaimer.bayerweb.com
________________________________________________________________________

<<inline: image001.gif>>

Reply via email to