You can create a array of component names such as;
then pass want you want into this function;
           private function makeElement(className:String, 
COMPONENTID:String):UIComponent {
                var objClass:Class = getDefinitionByName( className ) as Class; 
                if( objClass != null ) {                                        
                    var newObject:UIComponent = UIComponent( new objClass() );
           = COMPONENTID;
           = COMPONENTID;
                    return newObject;
                    return null;

then create a switch that looks at the resulting element and add any styles, or 
other properties to the element, or other elements, and add then to your 
container. The dropdown and datagrid will require extra code to provide a 
dataprovider, and you will have to add the default skin by a setStyle, but that 
should get you going in the right direction.

one cavot is that the id is not searchable you will have to search by name in 
the container, if you want to change the element after you add it to the 

I create elements dynamically by quering a database to create the elements 
needed in a flex applicaton, the structure and flow of forms are all in the 
database and I use flex to create the components on the fly...  


--- In, Angelo Anolin <angelo_ano...@...> wrote:
> Hi FlexCoders,
> I came across a Flex PM site and I would like to ask what are the necessary 
> controls / things I need to do to achieve the same application.
> The site's page is:
> I am having problems re-creating those items which expands when the plus sign 
> is 
> clicked as well as adding new items when the Add Milestone button is clicked. 
>  How do I achieve adding controls on the fly on the application?
> I hope you could provide some guidance on this.
> Thanks.
> Angelo

Reply via email to