Re: [flexcoders] Modules don't display radio buttons/ check box etc unless referenced in main app

2008-11-12 Thread Maciek Sakrejda
Excerpt from the Adobe docs follows, but basically, that's how it works.
If you want to avoid CheckBox references in the main app, you can load
the modules into the main app's application domain, but make sure you
trust the modules if you do that.

---
Adobe docs on modules:

By default, a module is loaded into a child domain of the current
application domain. You can specify a different application domain by
using the applicationDomain property of the ModuleLoader class. 

Because a module is loaded into a child domain, it owns class
definitions that are not in the main application's domain. For example,
the first module to load the PopUpManager class becomes the owner of the
PopUpManager class for the entire application because it registers the
manager with the SingletonManager. If another module later tries to use
the PopUpManager, Adobe ® Flash® Player throws an exception. 

The solution is to ensure that managers such as PopUpManager and
DragManager and any other shared services are defined by the main
application (or loaded late into the shell's application domain). When
you promote one of those classes to the shell, the class can then be
used by all modules. Typically, this is done by adding the following to
a script block:

import mx.managers.PopUpManager;
import mx.managers.DragManager;
private var popUpManager:PopUpManager;
private var dragManager:DragManager;


This technique also applies to components. The module that first uses
the component owns that component's class definition in its domain. As a
result, if another module tries to use a component that has already been
used by another module, its definition will not match the existing
definition. To avoid a mismatch of component definitions, create an
instance of the component in the main application. The result is that
the definition of the component is owned by the main application and can
be used by modules in any child domain.


-Original Message-
From: skuteboarding [EMAIL PROTECTED]
Reply-To: flexcoders@yahoogroups.com
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Modules don't display radio buttons/ check box etc
unless referenced in main app
Date: Wed, 12 Nov 2008 22:30:45 -

Hi, I've got a problem using modules and user interface components.
I have a module with a canvas on it and some buttons / radio buttons /
check boxes. In the main app I download the module, then add the
canvas to a container.

The buttons don't show properly (they all look like regular buttons,
but act like a radio button / check box).

The only way to fix it is to add a radio button / check box to the
main app. Adding the reference to a button in the main app makes it
work from the module.

I hope this makes sense.

Does anyone know how to make radio buttons / check boxes work without
having to add a radio button / check box somewhere in the main app?




 




RE: [flexcoders] Modules don't display radio buttons/ check box etc unless referenced in main app

2008-11-12 Thread Alex Harui
See modules presentation on my blog and shared code modules examples

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Maciek 
Sakrejda
Sent: Wednesday, November 12, 2008 4:00 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Modules don't display radio buttons/ check box etc 
unless referenced in main app


Excerpt from the Adobe docs follows, but basically, that's how it works.
If you want to avoid CheckBox references in the main app, you can load
the modules into the main app's application domain, but make sure you
trust the modules if you do that.

---
Adobe docs on modules:

By default, a module is loaded into a child domain of the current
application domain. You can specify a different application domain by
using the applicationDomain property of the ModuleLoader class.

Because a module is loaded into a child domain, it owns class
definitions that are not in the main application's domain. For example,
the first module to load the PopUpManager class becomes the owner of the
PopUpManager class for the entire application because it registers the
manager with the SingletonManager. If another module later tries to use
the PopUpManager, Adobe ® Flash® Player throws an exception.

The solution is to ensure that managers such as PopUpManager and
DragManager and any other shared services are defined by the main
application (or loaded late into the shell's application domain). When
you promote one of those classes to the shell, the class can then be
used by all modules. Typically, this is done by adding the following to
a script block:

import mx.managers.PopUpManager;
import mx.managers.DragManager;
private var popUpManager:PopUpManager;
private var dragManager:DragManager;

This technique also applies to components. The module that first uses
the component owns that component's class definition in its domain. As a
result, if another module tries to use a component that has already been
used by another module, its definition will not match the existing
definition. To avoid a mismatch of component definitions, create an
instance of the component in the main application. The result is that
the definition of the component is owned by the main application and can
be used by modules in any child domain.

-Original Message-
From: skuteboarding [EMAIL PROTECTED]mailto:mingram%40softease.com
Reply-To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com
To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com
Subject: [flexcoders] Modules don't display radio buttons/ check box etc
unless referenced in main app
Date: Wed, 12 Nov 2008 22:30:45 -

Hi, I've got a problem using modules and user interface components.
I have a module with a canvas on it and some buttons / radio buttons /
check boxes. In the main app I download the module, then add the
canvas to a container.

The buttons don't show properly (they all look like regular buttons,
but act like a radio button / check box).

The only way to fix it is to add a radio button / check box to the
main app. Adding the reference to a button in the main app makes it
work from the module.

I hope this makes sense.

Does anyone know how to make radio buttons / check boxes work without
having to add a radio button / check box somewhere in the main app?