actionscript自定义组件,定义的属性赋默认值:

  1. /**定义标尺的横纵样式*/  
  2.         private var _type:String;  
  3.           
  4.         [Inspectable(enumeration="vertical,horizontal")]  
  5.         /**定义标尺的横纵样式*/  
  6.         public function get type():String  
  7.         {  
  8.             return _type;  
  9.         }  
  10.  
  11.         /**  
  12.          * @private  
  13.          */  
  14.         public function set type(value:String):void  
  15.         {  
  16.             _type = value;  
  17.         }  

效果:

flex 学习笔记  as自定义组件(四)_flex