Ask a Question related to Macromedia Flex General Discussion, Design and Development.
-
meticoolus #1
Dynamically create Flex components
HI All,
I have a requirement wherein i need to create flex components like check
boxes, radio buttons or datagrid dynamically based on the values and type of
the components retrieved from the db.
What would be the best approach to achieve this.Pls help me with links and
sample codes.
Thanks in advance
meticoolus Guest
-
How to load Flex 2.0 components on Flex 1.5 application
Hello, I am currently working on an Flex 1.5 application and my client wants to import 2.0 components into it. Can we achieve that? if so how is... -
Flex 2B2 UI COmponents
Hi All... I am trying to get an application prototyped fairly quickly. Initially, I started using a Java Applet but there is a good bit of high... -
How do I dynamically bind two components?
How do I dynamically bind two components with out the use of the components inspector panel? My problem began when I dynamically created an... -
Dynamically Loading UI Components in MX 2004 Pro
Hello, I was wondering how to load the UI components like (RadioButton, Checkboxes, etc) dynamically at runtime. I was fooling around and... -
components for dynamically displaying data chart or graph in ASP
Hello, I tried to find some components I can use to dynamically generate chart or graph from database in ASP. It seems to me that only some... -
Saber Chebka #2
Re: Dynamically create Flex components
To create a dynamic Flex component, you can declare that component, instantiate it, then set it's properties at run-time.
Using method addChild , it will allow the add of this new component to an existing Flex UIComponent.
Here an example on how to add new button:
If you go inside more generic, you can use a switch/case statement in action script,var buttonNew:Button;
buttonNew = new Button; //create the button
buttonNew.label = "Create Canvas Control"; //set some properties
buttonNew.addEventListener("click",addCanvas); //set an event listener
this.addChild(buttonNew); //add the button to the DisplayList
If the component to add, is a button, use the above code, for other types, statement will be different.
An other solution is to think on is RSL(runtime shared libraries), here is an example following this link:
https://flexinonroids.wordpress.com/2009/05/27/flex-3-dynamically-loading-components-at-runtime/
Junior Member
- Join Date
- Jun 2011
- Posts
- 1



Reply With Quote

