This content has been marked as final. Show 3 replies
No, sorry, you can't do that. the Flash Player does not know anything about mxml.
Maybe we can help figure out something else?
Thanks for the quick response.
Well what I'm trying to do is dynamically generate form items on the screen from the database. I wrote a framework-ish for this in ActionScript and we're wondering how we can do this with flex. If the flash player knows nothing about mxml, so it must all be in the compiler.
Could I send an XML schema to the Form element to generate form items then?
Thanks and I look forward to your reply.
First, the simplest thing to look at is a Repeater. Its entire purpose is to repeat a component or set of components based on data.
If a Repeater is not flexible enough, and you want to be able to, say dynamically remove or add specific components ar run time based on changing data, you can use the addChild() removeChild() methods of Containers and States.
Finally, you can use the new keyword to instantiate any component pretty much anywhere.
By the way, don't get to hung up on the Form container at the expense of considering HBox, VBox and Canvas. The Form container can be restrictive when you get particular about your layout.