topical media & game development

talk show tell print

actionscript-eventflow-checkbox-CheckBoxIcon.ax

actionscript-eventflow-checkbox-CheckBoxIcon.ax [swf] flex


  package {
    import flash.display.*;
  
    // The graphical icon for a checkbox widget
    public class @ax-actionscript-eventflow-checkbox-CheckBoxIcon extends Sprite {
      
      // Constructor
      public function @ax-actionscript-eventflow-checkbox-CheckBoxIcon () {
        uncheck();      
      }
  
      // Draws a checkbox icon in the "checked" state
      public function check ():void {
        graphics.clear();
        graphics.lineStyle(1);
        graphics.beginFill(0xFFFFFF);
        graphics.drawRect(0, 0, 15, 15);
        graphics.endFill();
        graphics.lineTo(15, 15);
        graphics.moveTo(0, 15);
        graphics.lineTo(15, 0);
      }
  
      // Draws a checkbox icon in the "unchecked" state
      public function uncheck ():void {
        graphics.clear();
        graphics.lineStyle(1);
        graphics.beginFill(0xFFFFFF);
        graphics.drawRect(0, 0, 15, 15);
      }
    }
  }


(C) Æliens 27/08/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.