I've read everything off your blog (I have a RSS reader for a reason!)
including the stuff on modules, and this isn't about accessing the
module, at least as far as I think.

 

The example I posted, set the loaders application domain to new
Applicationdomain(null). That mean's no parent specified, so it becomes
a direct child of the system's ApplicationDomain. This means that any
classes loaded in that domain aren't checked against the classes loaded
in my current domain.

 

All well and good.

 

But when I add that loader as a child of the VBox, nothing appears. I'm
not trying to access the code in anyway. Does the fact that the code is
in another ApplicationDomain mean that the Manager's cannot also access
the code to display it? I would assume that the ModuleLoader could
access the classes and manage it's own display, so separation wouldn't
be a problem.

 

(As it happens, I think I've found a better solution around the problem,
but I'd still like to know the answer for this one).

 

Gk.

Gregor Kiddie
Senior Developer
INPS

Tel:       01382 564343

Registered address: The Bread Factory, 1a Broughton Street, London SW8
3QJ

Registered Number: 1788577

Registered in the UK

Visit our Internet Web site at www.inps.co.uk
<blocked::http://www.inps.co.uk/> 

The information in this internet email is confidential and is intended
solely for the addressee. Access, copying or re-use of information in it
by anyone else is not authorised. Any views or opinions presented are
solely those of the author and do not necessarily represent those of
INPS or any of its affiliates. If you are not the intended recipient
please contact [EMAIL PROTECTED]

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Alex Harui
Sent: 15 January 2008 19:33
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Application domain and Modules

 

Modules must have a common application domain otherwise you cannot
access them via classes or interfaces.  See my blog for more info
(blogs.adobe.com/aharui)

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Gregor Kiddie
Sent: Monday, January 14, 2008 5:00 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Application domain and Modules

 

Is there any reason why the below code would not work? Although I see
the module getting loaded when watching the debugger, and I can see that
the modules always get different Application domains, nothing ever gets
added to the Content Pane. It does when I load the module without the
new ApplicationDomain.

The module consists of a MXML view which is just a label, bound to a
singleton AS class. What I'm aiming for is the ability to load a module
with a singleton into the same application repeatedly, and have the
modules act completely seperately (i.e. there is two instances of the
singleton, one for each module).

Rogerg.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; 
    layout="vertical" 
    width="100%" 
    height="100%">
    
    <mx:Script>
    &nb! sp;   <![CDATA[
            import mx.modules.ModuleLoader;
            
            private function addModule() : void {
                var loader : ModuleLoader = new ModuleLoader();
                loader.url = "SampleModule.swf";
                contentPanel.addChild(loader);
            }
            
            private function addAppModule() : void {
                var loader : ModuleLoader ! = new ModuleLoader();
      &! nbsp; &n bsp;       loader.applicationDomain = new
ApplicationDomain();
                loader.url = "SampleModule.swf";
                loader.loadModule();
                contentPanel.addChild(loader);
            }
        ]]>
    </mx:Script>
    
    <mx:HBox>
        <mx:Button id="addButton" label="Add a module - SAME"
click="addModule()" />
        <mx:Button id="addAppButton" label="Add a module - NEW"
click="addAppModule()" />
    </mx:HBox>
   ! ; 
    <mx:VBox id="contentPanel" width="100%" height="100%" />
    
</mx:Application>




________________________________

Think you know your TV, music and film? Try Search Charades!
<https://www.searchcharades.com>  

 

Reply via email to