For example, you can define a custom button, derived from the Flex Button control, as the following example shows:
In this example, you write your MyButton control to the MyButton.as file, and you store the file in the myControls subdirectory of the root directory of your Flex application. The package name of your component reflects its location. In this example, the component's package name is myControls.
<mx:Application xmlns:mx=” http://www.adobe.com/2006/mxml ” xmlns:cmp=”myControls.*” >
In this example, you first define the cmp namespace that defines the location of your custom component in the application's directory structure. You then reference the component as an MXML tag using the namespace prefix.