Packagefl.events
Classpublic class InteractionInputType
InheritanceInteractionInputType Inheritance Object

Language Version : ActionScript 3.0
Player Version : Flash Player 9.0.28.0

The InteractionInputType class defines constants for the values of the triggerEvent property of the SliderEvent object. These constants define strings to identify the sources of input that can trigger an event: the mouse and the keyboard.

View the examples

See also

SliderEvent.triggerEvent


Public Properties
 PropertyDefined By
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
Public Methods
 MethodDefined By
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
Public Constants
 ConstantDefined By
  KEYBOARD : String = "keyboard"
[static] The InteractionInputType.KEYBOARD constant defines the value of the type property of a keyboard event object.
InteractionInputType
  MOUSE : String = "mouse"
[static] The InteractionInputType.MOUSE constant defines the value of the type property of a mouse event object.
InteractionInputType
Constant Detail
KEYBOARDConstant
public static const KEYBOARD:String = "keyboard"

Language Version : ActionScript 3.0
Player Version : Flash Player 9.0.28.0

The InteractionInputType.KEYBOARD constant defines the value of the type property of a keyboard event object.

MOUSEConstant 
public static const MOUSE:String = "mouse"

Language Version : ActionScript 3.0
Player Version : Flash Player 9.0.28.0

The InteractionInputType.MOUSE constant defines the value of the type property of a mouse event object.

Examples How to use examples
InteractionInputTypeExample.as

This example demonstrates how to determine whether a Slider instance has been moved with the keyboard or the mouse.

To run the example, follow these steps:

  1. Drag a Slider onto the Stage and name it slider.
  2. Drag a Label component onto the Stage and name it sliderLabel.
  3. Save this code as InteractionInputTypeExample.as in the same directory as your FLA file.
  4. Set the Document class in the FLA file to InteractionInputTypeExample.
package
{
    import fl.events.InteractionInputType;    
    import fl.events.SliderEvent;
    import flash.display.Sprite;
    import flash.text.TextFieldAutoSize;
    
    public class InteractionInputTypeExample extends Sprite    
    {
        public function InteractionInputTypeExample() {
            slider.addEventListener(SliderEvent.CHANGE, analyzeSliderInput);
            slider.addEventListener(SliderEvent.THUMB_DRAG, analyzeSliderInput);
            sliderLabel.autoSize = TextFieldAutoSize.LEFT;
            sliderLabel.text = "Select and move slider with keyboard or mouse";
            myLabel.autoSize = TextFieldAutoSize.LEFT;
            myLabel.text = "Lorem ipsum lorem ipsum lorem ipsum.";                        
        }
        private function analyzeSliderInput(e:SliderEvent):void {
            switch(e.triggerEvent) {
                case InteractionInputType.MOUSE:
                    sliderLabel.text = "Slider has been moved with mouse";                
                    break;
                case InteractionInputType.KEYBOARD:
                    sliderLabel.text = "Slider has been moved with keyboard";
                    break;
                default:
                    break;
            }
        }
    }
}