Flash 组件定义(AS3)

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);

		}

	}	

}

更多参考:http://www.adobe.com/devnet/flash/articles/creating_as3_components.html

你可能感兴趣的:(Flash)