Package | flash.events |
Class | public class StageOrientationEvent |
Inheritance | StageOrientationEvent Event Object |
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 2 |
setAspectRatio()
method of the Stage is called.
There are two types of StageOrientationEvent event:
The orientationChanging
(StageOrientationEvent.ORIENTATION_CHANGING
), is dispatched
before the screen changes to a new orientation. Calling the preventDefault()
method of the event object dispatched for orientationChanging prevents the stage from
changing orientation.
The orientationChange
(StageOrientationEvent.ORIENTATION_CHANGE
), is dispatched
after the screen changes to a new orientation.
Note: If the autoOrients
property is false
, then the stage orientation
does not change when a device is rotated. Thus, StageOrientationEvents are only dispatched for
device rotation when autoOrients
is true
.
Learn more
Related API Elements
Property | Defined By | ||
---|---|---|---|
afterOrientation : String [read-only]
The orientation of the stage after the change. | StageOrientationEvent | ||
beforeOrientation : String [read-only]
The orientation of the stage before the change. | StageOrientationEvent | ||
bubbles : Boolean [read-only]
Indicates whether an event is a bubbling event. | Event | ||
cancelable : Boolean [read-only]
Indicates whether the behavior associated with the event can be prevented. | Event | ||
constructor : Object
A reference to the class object or constructor function for a given object instance. | Object | ||
currentTarget : Object [read-only]
The object that is actively processing the Event object with an event listener. | Event | ||
eventPhase : uint [read-only]
The current phase in the event flow. | Event | ||
target : Object [read-only]
The event target. | Event | ||
type : String [read-only]
The type of event. | Event |
Method | Defined By | ||
---|---|---|---|
StageOrientationEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, beforeOrientation:String = null, afterOrientation:String = null)
Creates a StageOrientationEvent object with specific information relevant to stage orientation events. | StageOrientationEvent | ||
[override]
Creates a copy of the StageOrientationEvent object and sets the value of each property to match that of the original. | StageOrientationEvent | ||
A utility function for implementing the toString() method in custom
ActionScript 3.0 Event classes. | Event | ||
Indicates whether an object has a specified property defined. | Object | ||
Checks whether the preventDefault() method has been called on the event. | Event | ||
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter. | Object | ||
Cancels an event's default behavior if that behavior can be canceled. | Event | ||
Indicates whether the specified property exists and is enumerable. | Object | ||
Sets the availability of a dynamic property for loop operations. | Object | ||
Prevents processing of any event listeners in the current node and any subsequent nodes in
the event flow. | Event | ||
Prevents processing of any event listeners in nodes subsequent to the current node in the
event flow. | Event | ||
Returns the string representation of this object, formatted according to locale-specific conventions. | Object | ||
[override]
Returns a string that contains all the properties of the StageOrientationEvent object. | StageOrientationEvent | ||
Returns the primitive value of the specified object. | Object |
Constant | Defined By | ||
---|---|---|---|
ORIENTATION_CHANGE : String = "orientationChange" [static]
The ORIENTATION_CHANGE constant defines the value of the type property of
a orientationChange event object. | StageOrientationEvent | ||
ORIENTATION_CHANGING : String = "orientationChanging" [static]
The ORIENTATION_CHANGING constant defines the value of the type property of
a orientationChanging event object. | StageOrientationEvent |
afterOrientation | property |
beforeOrientation | property |
StageOrientationEvent | () | Constructor |
public function StageOrientationEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, beforeOrientation:String = null, afterOrientation:String = null)
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 2 |
Creates a StageOrientationEvent object with specific information relevant to stage orientation events. Event objects are passed as parameters to event listeners. Generally you do not create this event using the constructor function. Instead, you add an event listener on the Stage object to detect these events as they occur.
Parameterstype:String — The type of the event: StageOrientationEvent.ORIENTATION_CHANGE
| |
bubbles:Boolean (default = false ) — Indicates whether the Event object participates in the bubbling stage of the event flow.
| |
cancelable:Boolean (default = false ) — Indicates whether the Event object can be canceled.
| |
beforeOrientation:String (default = null ) — Indicates the orientation before the change.
| |
afterOrientation:String (default = null ) — Indicates the orientation after the change.
|
clone | () | method |
override public function clone():Event
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 2 |
Creates a copy of the StageOrientationEvent object and sets the value of each property to match that of the original.
ReturnsEvent — A new StageOrientationEvent object with property values that match those of the original.
|
toString | () | method |
override public function toString():String
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 2 |
Returns a string that contains all the properties of the StageOrientationEvent object. The string has the following format:
[StageOrientationEvent type=value bubbles=value cancelable=value beforeDisplayState=value afterDisplayState=value]
String — A string that contains all the properties of the StageOrientationEvent object.
|
ORIENTATION_CHANGE | Constant |
public static const ORIENTATION_CHANGE:String = "orientationChange"
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 2 |
The ORIENTATION_CHANGE
constant defines the value of the type
property of
a orientationChange
event object.
This event has the following properties:
Properties | Values |
---|---|
afterOrientation | The new orientation of the stage. |
beforeOrientation | The old orientation of the stage. |
target | The Stage object that dispatched the orientation change. |
bubbles | true |
currentTarget | Indicates the object that is actively processing the Event object with an event listener. |
cancelable | false ; it is too late to cancel the change. |
Related API Elements
ORIENTATION_CHANGING | Constant |
public static const ORIENTATION_CHANGING:String = "orientationChanging"
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 2 |
The ORIENTATION_CHANGING
constant defines the value of the type
property of
a orientationChanging
event object.
This event has the following properties:
Properties | Values |
---|---|
afterOrientation | The new orientation of the stage. |
beforeOrientation | The old orientation of the stage. |
target | The Stage object that dispatched the orientation change. |
bubbles | true |
currentTarget | Indicates the object that is actively processing the Event object with an event listener. |
cancelable | true . |
Wed Nov 21 2018, 06:34 AM -08:00