topical media & game development

talk show tell print

actionscript-events-ToggleEvent.ax

actionscript-events-ToggleEvent.ax [swf] flex


  package {
    import flash.events.*;
  
    // A class representing the custom "toggle" event
    public class @ax-actionscript-events-ToggleEvent extends Event {
      // A constant for the "toggle" event type
      public static const TOGGLE:String = "toggle";
  
      // Indicates whether the switch is now on or off
      public var isOn:Boolean;
      
      // Constructor
      public function @ax-actionscript-events-ToggleEvent (type:String,
                                   bubbles:Boolean = false,
                                   cancelable:Boolean = false,
                                   isOn:Boolean = false) {
        // Pass constructor parameters to the superclass constructor
        super(type, bubbles, cancelable);
        
        // Store the toggle switch's state so it can be accessed within
        // @ax-actionscript-events-ToggleEvent.TOGGLE listeners
        this.isOn = isOn;
      }
    }
  }


(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.