Flex custom mxml tags example
Flex .mxml files, whose functionalities are extended in to other Flex .mxml files are called custom mxml components. Custom mxml components are also referred to as custom mxml tags in the flex .mxml files in which their functionality is imported. Here, power.mxml is the custom mxml component whose functionality is been imported and used in the project.mxml file. Now in the base directory of project.mxml, i.e., C:\My Flex Folder, a folder solar is created and inside it the power.mxml file is placed. Now the complete folder path of power.mxml, i.e., solar.* is put in to the MyComps names space. This MyComps names space is used inside the project.mxml file to utilize the functionality of power.mxml file.
Now inside the <mx:Script > tags of power.mxml file, an include statement calls an action script file event.as. This action script file contains two functions with names Trinity and Neo respectively. Here, Neo is the event handler function. These functions are invoked through the open and change attributes of flex combo box control.
project.mxml
<?xml version="1.0"?>
|
basedirectory
power.mxml
<?xml version = '1.0' encoding = 'utf-8'?>
|
event.as
public function Trinity():void{
|
project.swf