This content has been marked as final. Show 4 replies
Yes. Regardless of whether you've written MyComponent.mxml or MyComponent.as, you can import MyComponent, use the 'new' operator to create an instance of it, and addChild() to add it to a parent component. Here's an example that assumes that the three files are in the same directory. It shows how to add an instance of the MXML component MyButton to the AS component MyBox. If you need your application to be AS instead of MXML, there are some additional complications.
wow its gr8 explained
Is it true that in a project we should have as many actionscript files as possible and only one mxml file. Is it a part of good practise of programming or some functionality enhancer.
Also i would like to how to make great use of the examples available at the adobe site for fles. For eg: Flickr API .
"...as many actionscript files as possible and only one mxml file..." No, this generalization is not correct.
The primary purpose of mxml is to increase productivity. Use whichever type of code works best for your particular task, component, etc.
When the app is compiled, the mxml is converted to as, then to swf, so there is no performance difference to the end user.