GODPAPER | All Packages | All Classes | Index | Frames No Frames |
ResizeEvent

Package | starling.events
Class | public class ResizeEvent
Inheritance | ResizeEvent Event Object

A ResizeEvent is dispatched by the stage when the size of the Flash container changes. Use it to update the Starling viewport and the stage size.

The event contains properties containing the updated width and height of the Flash player. If you want to scale the contents of your stage to fill the screen, update the `Starling.current.viewPort` rectangle accordingly. If you want to make use of the additional screen estate, update the values of `stage.stageWidth` and `stage.stageHeight` as well.

See also

starling.display.Stage
starling.core.Starling

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | bubbles : Boolean [read-only] Indicates if event will bubble. | Event
|  | currentTarget : EventDispatcher [read-only] The object the event is currently bubbling at. | Event
|  | data : Object [read-only] Arbitrary data that is attached to the event. | Event
|  | height : int [read-only] The updated height of the player. | ResizeEvent
|  | target : EventDispatcher [read-only] The object that dispatched the event. | Event
|  | type : String [read-only] A string that identifies the event. | Event
|  | width : int [read-only] The updated width of the player. | ResizeEvent

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | ResizeEvent(type:String, width:int, height:int, bubbles:Boolean = false) Creates a new ResizeEvent. | ResizeEvent
|  | stopImmediatePropagation():void Prevents any other listeners from receiving the event. | Event
|  | stopPropagation():void Prevents listeners at the next bubble stage from receiving the event. | Event
|  | toString():String Returns a description of the event, containing type and bubble information. | Event

Public Constants
Hide Inherited Public Constants
Show Inherited Public Constants

| Constant | Defined By
--- | --- | ---
|  | ADDED : String = added [static] Event type for a display object that is added to a parent. | Event
|  | ADDED_TO_STAGE : String = addedToStage [static] Event type for a display object that is added to the stage | Event
|  | CANCEL : String = cancel [static] An event type to be utilized in custom events. | Event
|  | CHANGE : String = change [static] An event type to be utilized in custom events. | Event
|  | CLOSE : String = close [static] An event type to be utilized in custom events. | Event
|  | COMPLETE : String = complete [static] Event type that may be used whenever something finishes. | Event
|  | CONTEXT3D_CREATE : String = context3DCreate [static] Event type for a (re)created stage3D rendering context. | Event
|  | ENTER_FRAME : String = enterFrame [static] Event type for a display object that is entering a new frame. | Event
|  | FLATTEN : String = flatten [static] Event type for a display object that is being flattened. | Event
|  | OPEN : String = open [static] An event type to be utilized in custom events. | Event
|  | REMOVED : String = removed [static] Event type for a display object that is removed from its parent. | Event
|  | REMOVED_FROM_STAGE : String = removedFromStage [static] Event type for a display object that is removed from the stage. | Event
|  | REMOVE_FROM_JUGGLER : String = removeFromJuggler [static] Event type for an animated object that requests to be removed from the juggler. | Event
|  | RESIZE : String = resize [static] Event type for a resized Flash player. | ResizeEvent
|  | ROOT_CREATED : String = rootCreated [static] Event type that indicates that the root DisplayObject has been created. | Event
|  | SCROLL : String = scroll [static] An event type to be utilized in custom events. | Event
|  | SELECT : String = select [static] An event type to be utilized in custom events. | Event
|  | TEXTURES_RESTORED : String = texturesRestored [static] Event type that is dispatched by the AssetManager after a context loss. | Event
|  | TRIGGERED : String = triggered [static] Event type for a triggered button. | Event

Property Detail

height | property

`height:int` [read-only]

The updated height of the player.

Implementation
`public function get height():int`

width | property |

`width:int` [read-only]

The updated width of the player.

Implementation
`public function get width():int`
Constructor Detail

ResizeEvent | () | Constructor

`public function ResizeEvent(type:String, width:int, height:int, bubbles:Boolean = false)`

Creates a new ResizeEvent.

Parameters

| `type:String`
| `width:int`
| `height:int`
| `bubbles:Boolean` (default = `false`)``

Constant Detail

RESIZE | Constant

`public static const RESIZE:String = resize`

Event type for a resized Flash player.

Thu Jan 16 2014, 01:11 PM +08:00