import mx.utils.Delegate; class WGCheckbox extends mx.core.UIComponent { var check : MovieClip; function WGCheckbox() { var instance=this; check._visible=false; //this.addEventListener("click" ,Delegate.create(this, _click)); this.onPress=function() { this.checked=!this.checked; instance.dispatchEvent( {type:"click",target:this} ); } } public function set checked(v) { check._visible=v; } public function get checked() { return check._visible; } }