From:http://www.cnblogs.com/XiaoG/archive/2010/08/03/1823600.html
AS3中定义组件的参数时需要用户元数据,一般通过Inspectable进行指定:
- package {
- import flash.display.MovieClip;
- public class ComponentTest extends MovieClip {
- private var _varName:String;
- public function ComponentTest() {
- // constructor code
- }
- [Inspectable(type="String",defaultValue="auto")]
- public function get varName():String
- {
- return _varName;
- }
- public function set varName(v:String):void
- {
- _varName = v;
- trace(this.varName);
- }
- }
- }