Using custom component in MXML


 

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.

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>

Ads