创建一个MyButton.as文件代码如下:
// ActionScript file
package myControls
{
import mx.controls.Button;
public class MyButton extends Button {
public function MyButton() {
this.label = "Click Me!";
}
}
}
在FLEX中调用实现自己定义的组件,代码如下:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
</mx:Application>
}
// ActionScript file
package myControls
{
import mx.controls.Button;
public class MyButton extends Button {
public function MyButton() {
this.label = "Click Me!";
}
}
}
在FLEX中调用实现自己定义的组件,代码如下:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:cmp="myControls.*"
>
<cmp:MyButton />
</mx:Application>
}