| Package | fl.events |
| Class | public class InteractionInputType |
| Inheritance | InteractionInputType Object |
| Language Version: | ActionScript 3.0 |
| Product Version: | Flash CS3 |
| Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0 |
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.
Related API Elements
Public Properties
| Property | Defined By | ||
|---|---|---|---|
![]() | constructor : Object
A reference to the class object or constructor function for a given object instance. | Object | |
Public Methods
| Method | Defined By | ||
|---|---|---|---|
![]() |
Indicates whether an object has a specified property defined. | Object | |
![]() |
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter. | Object | |
![]() |
Indicates whether the specified property exists and is enumerable. | Object | |
![]() |
Sets the availability of a dynamic property for loop operations. | Object | |
![]() |
Returns the string representation of this object, formatted according to locale-specific conventions. | Object | |
![]() |
Returns the string representation of the specified object. | Object | |
![]() |
Returns the primitive value of the specified object. | Object | |
Public Constants
| Constant | Defined 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
KEYBOARD | Constant |
public static const KEYBOARD:String = "keyboard"| Language Version: | ActionScript 3.0 |
| Product Version: | Flash CS3 |
| Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0 |
The InteractionInputType.KEYBOARD constant defines the value of
the type property of a keyboard event object.
MOUSE | Constant |
public static const MOUSE:String = "mouse"| Language Version: | ActionScript 3.0 |
| Product Version: | Flash CS3 |
| Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0 |
The InteractionInputType.MOUSE constant defines the value of
the type property of a mouse event object.
Examples How to use this example
InteractionInputTypeExample.as
This example demonstrates how to determine whether a Slider instance has been moved with the keyboard or the mouse.
- Drag a Slider onto the stage and name it
slider. - Drag a Label component onto the stage and name it
sliderLabel. - Save this code as InteractionInputTypeExample.as in the same directory as your FLA.
- Set the DocumentClass in the FLA to InteractionInputTypeExample.
package
{
import flash.display.Sprite;
import fl.events.SliderEvent;
import fl.events.InteractionInputType;
public class InteractionInputTypeExample extends Sprite
{
public function InteractionInputTypeExample() {
slider.addEventListener(SliderEvent.CHANGE, analyzeSliderInput);
slider.addEventListener(SliderEvent.THUMB_DRAG, analyzeSliderInput);
sliderLabel.autoSize = "left";
sliderLabel.text = "Select and move slider with keyboard or mouse";
}
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;
}
}
}
}
Thu Dec 4 2014, 05:50 PM -08:00
