Share on Google+Share on Google+

Using custom component in MXML

Advertisement
When you create custom component for your application or you want to use third party components in your application, you need to indicate where they are in your application directory structure.

Using custom component in MXML

When you create custom component for your application or you want to use third party components in your application, you need to indicate where they are in your application directory structure. For this, you required to specify a namespace definition for the component to identify the directory location.

For example, If you create custom component MyCustomButton in mycomp package in the application root directory, you specify the namespace as given below. In this example, CompRI will be used to refer the components which are packaged in mycomp directory.

 

<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
     
layout="
vertical"
     
xmlns:CompRI="
mycomp.*"> 

    <CompRI:MyCustomButton/>

</mx:Application>

Advertisements

Advertisement

Posted on: April 12, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.