Hi,

I have this implementation in my base class:

BaseSelector.mxml:

public static var MODULE:String = "core.dialogs.BaseDialog";

protected function handleSelectClick(event:MouseEvent):void
{
        Environment.loadModule(BaseSelector.MODULE, function 
(e:ModuleEvent):void
        {
                // Dialog creation
                var dialog:* = UIComponent(e.module.factory.create());
                                        
                dialog.multipleSelection = multipleSelection;
                                        
                assignDialogHandlers(dialog);
                                        
                PopUpManager.addPopUp(dialog, Environment.getApplication(), 
true);
                PopUpManager.centerPopUp(dialog);
        }, true);
}


As you may see, I have a constant being defined in base class.
Each subclass defines a new MODULE name, and the handleSelectClick
need to be able to load it and instantiate a new Dialog component
(BaseSelector.MODULE).

So imagine I have a CompanySelector.mxml, which extends from BaseSelector.mxml:

public static var MODULE:String = "app.dialogs.CompanyDialog";


And nothing else.
The button event listener (handleSelectClick) should be able to
recognize the MODULE defined in subclass and define the subclass one
to be loaded.
I tried it by several ways to achieve the same thing as "self" in some
known languages, without success.


Has anyone any ideas how to do that?



Regards,

-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil

Reply via email to