| Package | org.papervision3d.core.utils.virtualmouse |
| Class | public class VirtualMouse |
| Inheritance | VirtualMouse flash.events.EventDispatcher |
| Property | Defined by | ||
|---|---|---|---|
| container : Sprite | VirtualMouse | ||
| lastEvent : Event [read-only]
The last event dispatched by the VirtualMouse
instance.
| VirtualMouse | ||
| mouseIsDown : Boolean [read-only]
True if the virtual mouse is being
pressed, false if not.
| VirtualMouse | ||
| stage : Stage
A reference to the Stage instance.
| VirtualMouse | ||
| useNativeEvents : Boolean
Determines if the events dispatched by the
VirtualMouse instance are IVirualMouseEvent
Events (wrapping Event and MouseEvent) or events
of the native Event and MouseEvent type.
| VirtualMouse | ||
| x : Number
The x location of the virtual mouse.
| VirtualMouse | ||
| y : Number
The y location of the virtual mouse.
| VirtualMouse | ||
| Method | Defined by | ||
|---|---|---|---|
|
VirtualMouse(stage:Stage = null, container:Sprite = null, startX:Number = 0, startY:Number = 0)
Initializes a new VirtualMouse instance.
| VirtualMouse | ||
|
click():void
Simulates a click of the left
mouse button (press and release)
| VirtualMouse | ||
|
disableEvent(type:String):void
Allows you to disable an event by type
preventing the virtual mouse from
dispatching that event during an update.
| VirtualMouse | ||
|
doubleClick():void
Simulates a double-click of the left
mouse button (press and release twice).
| VirtualMouse | ||
|
enableEvent(type:String):void
Re-enables an event disabled with
disableEvent.
| VirtualMouse | ||
|
exitContainer():void
| VirtualMouse | ||
|
getLocation():Point
Returns the location (x and y) of the current
VirtualMouse instance.
| VirtualMouse | ||
|
ignore(instance:DisplayObject):void
Ignores a display object preventing that
object from recieving events from the
virtual mouse.
| VirtualMouse | ||
|
lock():void
Locks the current VirtualMouse instance
preventing updates from being made as
properties change within the instance.
| VirtualMouse | ||
|
press():void
Simulates the pressing of the left
mouse button.
| VirtualMouse | ||
|
release():void
Simulates the release of the left
mouse button.
| VirtualMouse | ||
|
setLocation(a:*, b:* = null):void
Sets the location (x and y) of the current
VirtualMouse instance.
| VirtualMouse | ||
|
unignore(instance:DisplayObject):void
Removes an instance from the ignore list
defined by ignore().
| VirtualMouse | ||
|
unlock():void
Unlocks the current VirtualMouse instance
allowing updates to be made for the
dispatching of virtual mouse events.
| VirtualMouse | ||
|
update():void
Updates the VirtualMouse instance's state
to reflect a change in the virtual mouse.
| VirtualMouse | ||
| Event | Summary | Defined by | ||
|---|---|---|---|---|
| Dispatched when the virtual mouse fires an MouseEvent.CLICK event. | VirtualMouse | |||
| Dispatched when the virtual mouse fires an MouseEvent.DOUBLE_CLICK event. | VirtualMouse | |||
| Dispatched when the virtual mouse fires an MouseEvent.MOUSE_DOWN event. | VirtualMouse | |||
| Dispatched when the virtual mouse fires an Event.MOUSE_LEAVE event. | VirtualMouse | |||
| Dispatched when the virtual mouse fires an MouseEvent.MOUSE_MOVE event. | VirtualMouse | |||
| Dispatched when the virtual mouse fires an MouseEvent.MOUSE_OUT event. | VirtualMouse | |||
| Dispatched when the virtual mouse fires an MouseEvent.MOUSE_OVER event. | VirtualMouse | |||
| Dispatched when the virtual mouse fires an MouseEvent.MOUSE_UP event. | VirtualMouse | |||
| Dispatched when the virtual mouse fires an MouseEvent.ROLL_OUT event. | VirtualMouse | |||
| Dispatched when the virtual mouse fires an MouseEvent.ROLL_OVER event. | VirtualMouse | |||
| Dispatched when the virtual mouse state is updated. | VirtualMouse | |||
| Constant | Defined by | ||
|---|---|---|---|
| UPDATE : String = "update" [static]
| VirtualMouse | ||
| container | property |
container:Sprite [read-write]Implementation
public function get container():Sprite
public function set container(value:Sprite):void
| lastEvent | property |
lastEvent:Event [read-only]The last event dispatched by the VirtualMouse instance. This can be useful for preventing event recursion if performing VirtualMouse operations within MouseEvent handlers.
Implementation public function get lastEvent():Event
| mouseIsDown | property |
mouseIsDown:Boolean [read-only]True if the virtual mouse is being pressed, false if not. The mouse is down for the virtual mouse if press() was called.
Implementation public function get mouseIsDown():Boolean
See also
| stage | property |
stage:Stage [read-write]A reference to the Stage instance. This reference needs to be passed to the VirtualMouse instance either in its constructor or through assigning it's stage property. Without a valid reference to the stage, the virtual mouse will not function.
Implementation public function get stage():Stage
public function set stage(value:Stage):void
See also
| useNativeEvents | property |
useNativeEvents:Boolean [read-write]Determines if the events dispatched by the VirtualMouse instance are IVirualMouseEvent Events (wrapping Event and MouseEvent) or events of the native Event and MouseEvent type. When using non-native events, you can check to see if the events originated from VirtualMouse by seeing if the events are of the type IVirualMouseEvent.
Implementation public function get useNativeEvents():Boolean
public function set useNativeEvents(value:Boolean):void
See also
| x | property |
x:Number [read-write]The x location of the virtual mouse. If you are setting both the x and y properties of the virtual mouse at the same time, you would probably want to lock the VirtualMouse instance to prevent additional events from firing.
Implementation public function get x():Number
public function set x(value:Number):void
See also
| y | property |
y:Number [read-write]The y location of the virtual mouse. If you are setting both the x and y properties of the virtual mouse at the same time, you would probably want to lock the VirtualMouse instance to prevent additional events from firing.
Implementation public function get y():Number
public function set y(value:Number):void
See also
| VirtualMouse | () | constructor |
public function VirtualMouse(stage:Stage = null, container:Sprite = null, startX:Number = 0, startY:Number = 0)Initializes a new VirtualMouse instance.
Parametersstage:Stage (default = null) — A reference to the stage instance.
|
|
container:Sprite (default = null) — The initial x location of
the virtual mouse.
|
|
startX:Number (default = 0) — The initial y location of
the virtual mouse.
|
|
startY:Number (default = 0) |
| click | () | method |
public function click():voidSimulates a click of the left mouse button (press and release)
See also
| disableEvent | () | method |
public function disableEvent(type:String):voidAllows you to disable an event by type preventing the virtual mouse from dispatching that event during an update.
Parameterstype:String — The type for the event to
disable, e.g. MouseEvent.CLICK
|
See also
| doubleClick | () | method |
public function doubleClick():voidSimulates a double-click of the left mouse button (press and release twice). Calling this command is the only way to simulate a double-click for the virtual mouse. Calling press() and release() or click() is rapid succession will not invoke a double-click event. The double-click event will also only fire for an instance if it's doubleClickEnabled property is set to true.
See also
| enableEvent | () | method |
public function enableEvent(type:String):voidRe-enables an event disabled with disableEvent.
Parameterstype:String — The type for the event to
enable, e.g. MouseEvent.CLICK
|
See also
| exitContainer | () | method |
public function exitContainer():void
| getLocation | () | method |
public function getLocation():PointReturns the location (x and y) of the current VirtualMouse instance. The location of the virtual mouse is based in the global coordinate space.
ReturnsPoint — A Point instance representing the
location of the virtual mouse in
global coordinate space.
|
See also
| ignore | () | method |
public function ignore(instance:DisplayObject):voidIgnores a display object preventing that object from recieving events from the virtual mouse. This is useful for instances used for cursors which may always be under the virtual mouse's location.
Parametersinstance:DisplayObject — A reference to the
DisplayObject instance to ignore.
|
See also
| lock | () | method |
public function lock():voidLocks the current VirtualMouse instance preventing updates from being made as properties change within the instance. To release and allow an update, call unlock().
See also
| press | () | method |
public function press():voidSimulates the pressing of the left mouse button. To release the mouse button, use release().
See also
| release | () | method |
public function release():voidSimulates the release of the left mouse button. This method has no effect unless press() was called first.
See also
| setLocation | () | method |
public function setLocation(a:*, b:* = null):voidSets the location (x and y) of the current VirtualMouse instance. There are two ways to call setLocation, either passing in a single Point instance, or by passing in two Number instances representing x and y coordinates. The location of the virtual mouse is based in the global coordinate space.
Parametersa:* — A Point instance or x Number value.
|
|
b:* (default = null) — A y Number value if a is a Number.
|
See also
| unignore | () | method |
public function unignore(instance:DisplayObject):voidRemoves an instance from the ignore list defined by ignore(). When an ingored object is passed into unignore(), it will be able to receive events from the virtual mouse.
Parametersinstance:DisplayObject — A reference to the
DisplayObject instance to unignore.
|
See also
| unlock | () | method |
public function unlock():voidUnlocks the current VirtualMouse instance allowing updates to be made for the dispatching of virtual mouse events. After unlocking the instance, it will update and additional calls to press(), release(), or changing the location of the virtual mouse will also invoke updates.
See also
| update | () | method |
public function update():voidUpdates the VirtualMouse instance's state to reflect a change in the virtual mouse. Within this method all events will be dispatched. update() is called any time a VirtualMouse property is changed unless lock() was used to lock the instance. update() will then not be called until unlock() is used to unlock the instance. Typically you would never call update() directly; it is called automatically by the VirtualMouse class. Calling update() manually will override lock(). Whenever update() is called, the UPDATE event is dispatched.
See also
| click | event |
flash.events.MouseEvent
Dispatched when the virtual mouse fires an MouseEvent.CLICK event.
| doubleClick | event |
flash.events.MouseEvent
Dispatched when the virtual mouse fires an MouseEvent.DOUBLE_CLICK event.
| mouseDown | event |
flash.events.MouseEvent
Dispatched when the virtual mouse fires an MouseEvent.MOUSE_DOWN event.
| mouseLeave | event |
flash.events.Event
Dispatched when the virtual mouse fires an Event.MOUSE_LEAVE event.
| mouseMove | event |
flash.events.MouseEvent
Dispatched when the virtual mouse fires an MouseEvent.MOUSE_MOVE event.
| mouseOut | event |
flash.events.MouseEvent
Dispatched when the virtual mouse fires an MouseEvent.MOUSE_OUT event.
| mouseOver | event |
flash.events.MouseEvent
Dispatched when the virtual mouse fires an MouseEvent.MOUSE_OVER event.
| mouseUp | event |
flash.events.MouseEvent
Dispatched when the virtual mouse fires an MouseEvent.MOUSE_UP event.
| rollOut | event |
flash.events.MouseEvent
Dispatched when the virtual mouse fires an MouseEvent.ROLL_OUT event.
| rollOver | event |
flash.events.MouseEvent
Dispatched when the virtual mouse fires an MouseEvent.ROLL_OVER event.
| update | event |
| UPDATE | constant |
public static const UPDATE:String = "update"