I'm not familiar enough with the Java class loader to offer any comparisons.  
For sure, when a class is not found in Actionscript, the whole app halts and 
any code that was supposed to run after that does not run.

Your workaround is indicative of the shared code problem discussed in the 
presentation on Modules on my blog.  Perhaps that presentation will help you 
understand the root of your problem.

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Jim Boone
Sent: Thursday, January 08, 2009 5:26 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Module blues...am I going crazy??


Perhaps. However, I am attempting to use PureMVC multi-core and the
constants I want to use simple define my notification names. Even
thought they are included only in the module code, for some reason the
names are "undefined" when PureMVC attempts to register my commands
when the module PureMVC initializes. I have found a work around by
placing the notification constants in a common library. It isn't the
best work around, but I need to make some progress.

In the Java world, I am used to getting ClassNotFound exceptions when
messing with class loader and isolation issues (at least Java will
blow chunks if it can't find something verses failing silently). The
only equivalent I can find in AS3 is Application domain. It doesn't
seem to matter if I load the module in the current domain though
(Application.currentDomain). Oh well...any other thoughts? Is this
situation analogous to a Java classloader isolation problem?

--- In flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>, Alex 
Harui <aha...@...> wrote:
>
> If the app references a class in a module, it defeats the whole
purpose of modules. That class will still be linked into the main app.
>
> Also note that the order that classes get their static initialized
is "random" so be careful if static are anything other than simple values.
>
> From: flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com> 
> [mailto:flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>]
On Behalf Of Jim Boone
> Sent: Thursday, January 08, 2009 8:46 AM
> To: flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>
> Subject: [flexcoders] Module blues...am I going crazy??
>
>
> Hi,
>
> I am attempting to convert an app to use modules but I am seeing
> strange behavior. For example, say I have a constant that I refer to
> as (see Constants class below):
>
> Constants.something
>
> in my code. You would expect it to resolve to the string "someThing".
> Unfortunately, after being loaded as a module, Constants.something is
> undefined, not "someThing"!! Is there something magic about static
> constants when they are used in modules? Has anyone ever seen this
> issue?
>
> Jim
> ---------------
> package blah{
>
> public class Constants
> {
> public static const something:String = "someThing";
>
> }
>
> }
>

Reply via email to