Hi,
I am using Flex 1.5 and I am creating custom components dynamically from its
classnames like this:
// got a class name
var windowName:String = "TitleWindowData";
//create a instance of this title window
var oInitObj:Object = new Object();
oInitObj.title = "Title Window Data";
oInitObj.width = 600;
oInitObj.height = 200;
var titleWindowInstance:Object =
TitleWindow(PopUpManager.createPopUp(this,
mx.utils.ClassUtil.findClass(windowName),
false,
oInitObj,
false));
titleWindowInstance.centerPopUp(this);
I know I have to register a class like this before I create an instance
like:
Object.registerClass("TitleWindowTest", TitleWindowData);
Now I look for a way to safe this step. Is there a way?
I was wondering, if it would be helpful to create a SWC and mymanifest.xml
of TitleWindowData.mxml
with the compc.exe and set it in the flex-config.xml like this:
..
<namespace uri="http://www.top21.de/2005/mxml/brochureConf">
<manifest>/WEB-INF/flex/brochureConf-manifest.xml</manifest>
</namespace>
..
But I still have to call Object.registerClass before I can create an
instance, although the file should be known to the flex application already.
Did I miss something? Is there no way to get rid of the
Object.registerClass()
call for every component I want to create dynamically out of classnames ???
Cheers,
Christoph
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/