Your application file itself should be MXML. In other words, you should have at least an <mx:Application> tag, or you'll run into various problems. But every other component instance can easily be programmatically created using 'new'. I'm not very knowledgeable about states, but I'm pretty sure that you can programmatically generate them also. - Gordon
________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of systemsforge Sent: Saturday, March 10, 2007 11:37 AM To: [email protected] Subject: [flexcoders] n00b question on dynamic generation of UI components Just wondering, is it possible to completely programmatically generate all interface elements at runtime in Flex (i.e. do you HAVE to have any compile time MXML or can you dynamically generate your entire UI on the fly using AS if you so wish). Simple example, want to generate forms for CRUD. I could code gen a set of MXML files or I could (hopefully) write dynamic AS that'd take a field list and create the appropriate components at runtime. Ignoring performance issues for now, are there any limitations/gotchas in completely dynamically generated UIs based on AS? Also, can you dynamically add/edit/delete view states just using AS? Any hints/tips much appreciated. Best Wishes, Peter

