You should be looking into createChild, you
can’t do “new” for UI objects. Check out this page in the docs:
http://livedocs.macromedia.com/flex/15/flex_docs_en/00001064.htm
Matt
Good day All.
Am developing a Web-application at the moment that displays information using
Grids and Graphs..
Because of the nature of the Swfs compiled by Flex i use alot of dynamic
instanciation for my views
But it seems that the DataGrid component has a bug where-by when it resides on
a component/view that is instanciated dynamically it throws and error
as soon as it is created.
but if i create it by directly specifying the class i want to create with the
addChild method like so..
viewcontainer.addChild(new LookOut()) then it works..
but u see i want to have on central method to create all my view that i display
in the views display area, so the parameter i would pass to the Function would
be the name of the Component that i want to create
so my method would look something like this
private function createView(NameOfView:Class):Void {
viewContainer.addChild(new
NameOfClass());
}
so this method will be used across the board...but it seems if i use this
method..and i have a dataGrid component within..- my view the DataGrid
Component throws an error as soon as it is created..
but!!- if i say viewContainer.addChild(new LookOut()) no error is
thrown..
Really can't tell whats happening.. is this a bug..or should i just not do
that..
Regards
--
Kenlie Browne
Software Developer
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
YAHOO! GROUPS LINKS
|
- RE: [flexcoders] DataGrid Bug? Matt Chotin
-