package com.exanimo.events { import flash.events.Event; /** * * The StateManagerEvent class defines events that are associated with the * StateManager class. * * @see http://exanimo.com/actionscript/statemanager/ * * @author Matthew Tretter (matthew@exanimo.com) * @version 2007.04.30 * */ public class StateManagerEvent extends Event { public static const STATE_CHANGE:String = 'stateChange'; public static const STATE_SET:String = 'stateSet'; public static const STATE_REVISIT:String = 'stateRevisit'; private var _id:String; /** * * Creates a new StateManagerEvent object that contains information * about a StateManager event. A StateManagerEvent object is passed as a * parameter to an event listener. * * @param type * The type of the event. Event listeners can access this * information through the type property of the event object. A * StateManager can have the following types of events: * StateManagerEvent.STATE_CHANGE, StateManagerEvent.STATE_SET, * StateManagerEvent.STATE_REVISIT. * @param bubbles * Determines whether the StateManagerEvent object participates in * the bubbling phase of the event flow. Event listeners can access * this information through the bubbles property of the event * object. * @param cancelable * Determines whether the StateManagerEvent object can be canceled. * Event listeners can access this information through the * cancelable property of the event object. * @param id * The id of the current state. * */ public function StateManagerEvent(type:String, bubbles:Boolean, cancelable:Boolean, id:String) { super(type, bubbles, cancelable); this._id = id; } // // accessors // /** * * Gets the id of the current state. * */ public function get id():String { return this._id; } // // public methods // /** * * Creates a copy of the StateManagerEvent object and sets the value of * each parameter to match the original. * * @return * A new StateManagerEvent object with property values that match * those of the original. * */ override public function clone():Event { return new StateManagerEvent(this.type, this.bubbles, this.cancelable, this.id); } /** * * Returns a string that contains all the properties of the * StateManagerEvent object. The string is in the following format: * * [StateManagerEvent type=value bubbles=value cancelable=value id=value] * * @return * A string representation of the StateManagerEvent object. * */ override public function toString():String { return this.formatToString('StateManagerEvent', 'type', 'bubbles', 'cancelable', 'id'); } } }