views:

282

answers:

2

How do I say an MXML component is inside some package? Well, it's in a different folder... I know how to do it ActionScript... But when I do in MXML I don't declare the package explicitly because I don't know how, and when I call it to my application, it states that

The prefix "package" for element "package:Component" is not bound.

+4  A: 

Hope this helps. For a component just create it in a new folder and from your base class when your invoking that component just invoke it with a new namespace.

e.g if you create a new component say employee_list.mxml in src/component folder

and if you have your main app file ALL_EMP.mxml in src/ folder then to invoke the component you defined in src/component folder use a namespace as

< mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:Comp="component.*" layout="horizontal" >

then you can invoke the component directly in mxml as (tag specific to your App)...

it is somewhat similar to creating and using Taglibs in JSPs...

Rajat
+2  A: 

Check out the screencast for the Components chapter of First Steps in Flex. It explains this in detail.

James Ward