Package | spark.components |
Class | public class TitleWindow |
Inheritance | TitleWindow ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Language Version: | ActionScript 3.0 |
Product Version: | Flex 4 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
![]() | Because this component does not define a skin for the mobile theme, Adobe recommends that you not use it in a mobile application. Alternatively, you can define your own mobile skin for the component. For more information, see Basics of mobile skinning. |
The TitleWindow class extends Panel to include a close button and move area.
The TitleWindow is designed as a pop-up window.
Do not create a TitleWindow in MXML as part of an application.
Instead, you typically create a custom MXML component based on
the TitleWindow class, and then use the
PopUpManager.createPopUp()
method to pop up the component,
and the PopUpManager.removePopUp()
method
to remove the component.
The TitleWindow container has the following default sizing characteristics:
Characteristic | Description |
---|---|
Default size | Height is large enough to hold all of the children in the content area at the default or explicit heights of the children, plus the title bar and border, plus any vertical gap between the children, plus the top and bottom padding of the container. Width is the larger of the default or explicit width of the widest child, plus the left and right container borders padding, or the width of the title text. |
Default skin class | spark.skins.spark.TitleWindowSkin |

The <s:TitleWindow>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:TitleWindow> Events close="No default" windowMove="No default" windowMoveEnd="No default" windowMoveStart="No default" windowMoving="No default" </s:TitleWindow>
Default MXML PropertymxmlContentFactory
More examples
Using the PopUpManager to create a Spark TitleWindow container
Dragging the popup Spark TitleWindow
Passing data to and from a Spark pop-up window
Related API Elements
spark.skins.spark.TitleWindowSkin
spark.skins.spark.TitleWindowCloseButtonSkin
mx.managers.PopUpManager
Method | Defined By | ||
---|---|---|---|
![]() | addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener
receives notification of an event. | EventDispatcher | |
![]() |
Indicates whether the security restrictions
would cause any display objects to be omitted from the list returned by calling
the DisplayObjectContainer.getObjectsUnderPoint() method
with the specified point point. | DisplayObjectContainer | |
![]() |
Determines whether the specified display object is a child of the DisplayObjectContainer instance or
the instance itself. | DisplayObjectContainer | |
![]() |
Returns a rectangle that defines the area of the display object relative to the coordinate system
of the targetCoordinateSpace object. | DisplayObject | |
![]() |
Returns the child display object that exists with the specified name. | DisplayObjectContainer | |
![]() |
Returns an array of objects that lie under the specified point and are children
(or grandchildren, and so on) of this DisplayObjectContainer instance. | DisplayObjectContainer | |
![]() |
Returns a rectangle that defines the boundary of the display object,
based on the coordinate system defined by the targetCoordinateSpace
parameter, excluding any strokes on shapes. | DisplayObject | |
![]() |
Converts the point object from the Stage (global) coordinates
to the display object's (local) coordinates. | DisplayObject | |
![]() |
Converts a two-dimensional point from the Stage (global) coordinates to a
three-dimensional display object's (local) coordinates. | DisplayObject | |
![]() |
Checks whether the EventDispatcher object has any listeners registered for a specific type
of event. | EventDispatcher | |
![]() |
Indicates whether an object has a specified property defined. | Object | |
![]() |
Evaluates the bounding box of the display object to see if it overlaps or intersects with the
bounding box of the obj display object. | DisplayObject | |
![]() |
Evaluates the display object to see if it overlaps or intersects with the
point specified by the x and y parameters. | DisplayObject | |
![]() |
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter. | Object | |
![]() |
Converts a three-dimensional point of the three-dimensional display
object's (local) coordinates to a two-dimensional point in the Stage (global) coordinates. | DisplayObject | |
![]() |
Converts the point object from the display object's (local) coordinates to the
Stage (global) coordinates. | DisplayObject | |
![]() |
Indicates whether the specified property exists and is enumerable. | Object | |
![]() |
Removes all child DisplayObject instances from the child list of the DisplayObjectContainer instance. | DisplayObjectContainer | |
![]() |
Removes a listener from the EventDispatcher object. | EventDispatcher | |
![]() |
Raises a virtual keyboard. | InteractiveObject | |
![]() |
Sets the availability of a dynamic property for loop operations. | Object | |
![]() |
Lets the user drag the specified sprite. | Sprite | |
![]() |
Lets the user drag the specified sprite on a touch-enabled device. | Sprite | |
![]() |
Recursively stops the timeline execution of all MovieClips rooted at this object. | DisplayObjectContainer | |
![]() |
Ends the startDrag() method. | Sprite | |
![]() |
Ends the startTouchDrag() method, for use with touch-enabled devices. | Sprite | |
![]() |
Returns the string representation of this object, formatted according to locale-specific conventions. | Object | |
![]() |
Returns the primitive value of the specified object. | Object | |
![]() |
Checks whether an event listener is registered with this EventDispatcher object or any of
its ancestors for the specified event type. | EventDispatcher |
Event | Summary | Defined By | ||
---|---|---|---|---|
![]() | [broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active. | EventDispatcher | ||
![]() | Dispatched when a display object is added to the display list. | DisplayObject | ||
![]() | Dispatched when a display object is added to the on stage display list, either directly or through the addition of a sub tree in which the display object is contained. | DisplayObject | ||
![]() | Dispatched when the user selects 'Clear' (or 'Delete') from the text context menu. | InteractiveObject | ||
![]() | Dispatched when a user presses and releases the main button of the user's pointing device over the same InteractiveObject. | InteractiveObject | ||
![]() | Dispatched when a user gesture triggers the context menu associated with this interactive object in an AIR application. | InteractiveObject | ||
![]() | Dispatched when the user activates the platform-specific accelerator key combination for a copy operation or selects 'Copy' from the text context menu. | InteractiveObject | ||
![]() | Dispatched when the user activates the platform-specific accelerator key combination for a cut operation or selects 'Cut' from the text context menu. | InteractiveObject | ||
![]() | [broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive. | EventDispatcher | ||
![]() | Dispatched when a user presses and releases the main button of a pointing device twice in rapid succession over the same InteractiveObject when that object's doubleClickEnabled flag is set to true. | InteractiveObject | ||
![]() | [broadcast event] Dispatched when the playhead is entering a new frame. | DisplayObject | ||
![]() | [broadcast event] Dispatched when the playhead is exiting the current frame. | DisplayObject | ||
![]() | Dispatched after a display object gains focus. | InteractiveObject | ||
![]() | Dispatched after a display object loses focus. | InteractiveObject | ||
![]() | [broadcast event] Dispatched after the constructors of frame display objects have run but before frame scripts have run. | DisplayObject | ||
![]() | Dispatched when the user creates a point of contact along the edge of the touch surface with an InteractiveObject instance, (such as tapping along the edge of the touch surface on Siri Remote for Apple TV) Some devices might also interpret this contact as a combination of several touch events, as well. | InteractiveObject | ||
![]() | Dispatched when the user presses two points of contact over the same InteractiveObject instance on a touch-enabled device (such as presses and releases two fingers over a display object on a mobile phone or tablet with a touch screen). | InteractiveObject | ||
![]() | Dispatched when the user moves a point of contact over the InteractiveObject instance on a touch-enabled device (such as moving a finger from left to right over a display object on a mobile phone or tablet with a touch screen). | InteractiveObject | ||
![]() | Dispatched when the user performs a rotation gesture at a point of contact with an InteractiveObject instance (such as touching two fingers and rotating them over a display object on a mobile phone or tablet with a touch screen). | InteractiveObject | ||
![]() | Dispatched when the user performs a swipe gesture at a point of contact with an InteractiveObject instance (such as touching three fingers to a screen and then moving them in parallel over a display object on a mobile phone or tablet with a touch screen). | InteractiveObject | ||
![]() | Dispatched when the user creates a point of contact with an InteractiveObject instance, then taps on a touch-enabled device (such as placing several fingers over a display object to open a menu and then taps one finger to select a menu item on a mobile phone or tablet with a touch screen). | InteractiveObject | ||
![]() | Dispatched when the user performs a zoom gesture at a point of contact with an InteractiveObject instance (such as touching two fingers to a screen and then quickly spreading the fingers apart over a display object on a mobile phone or tablet with a touch screen). | InteractiveObject | ||
![]() | This event is dispatched to any client app that supports inline input with an IME | InteractiveObject | ||
![]() | Dispatched when the user presses a key. | InteractiveObject | ||
![]() | Dispatched when the user attempts to change focus by using keyboard navigation. | InteractiveObject | ||
![]() | Dispatched when the user releases a key. | InteractiveObject | ||
![]() | Dispatched when a user presses and releases the middle button of the user's pointing device over the same InteractiveObject. | InteractiveObject | ||
![]() | Dispatched when a user presses the middle pointing device button over an InteractiveObject instance. | InteractiveObject | ||
![]() | Dispatched when a user releases the pointing device button over an InteractiveObject instance. | InteractiveObject | ||
![]() | Dispatched when a user presses the pointing device button over an InteractiveObject instance. | InteractiveObject | ||
![]() | Dispatched when the user attempts to change focus by using a pointer device. | InteractiveObject | ||
![]() | Dispatched when a user moves the pointing device while it is over an InteractiveObject. | InteractiveObject | ||
![]() | Dispatched when the user moves a pointing device away from an InteractiveObject instance. | InteractiveObject | ||
![]() | Dispatched when the user moves a pointing device over an InteractiveObject instance. | InteractiveObject | ||
![]() | Dispatched when a user releases the pointing device button over an InteractiveObject instance. | InteractiveObject | ||
![]() | Dispatched when a mouse wheel is spun over an InteractiveObject instance. | InteractiveObject | ||
![]() | Dispatched by the drag initiator InteractiveObject when the user releases the drag gesture. | InteractiveObject | ||
![]() | Dispatched by the target InteractiveObject when a dragged object is dropped on it and the drop has been accepted with a call to DragManager.acceptDragDrop(). | InteractiveObject | ||
![]() | Dispatched by an InteractiveObject when a drag gesture enters its boundary. | InteractiveObject | ||
![]() | Dispatched by an InteractiveObject when a drag gesture leaves its boundary. | InteractiveObject | ||
![]() | Dispatched by an InteractiveObject continually while a drag gesture remains within its boundary. | InteractiveObject | ||
![]() | Dispatched at the beginning of a drag operation by the InteractiveObject that is specified as the drag initiator in the DragManager.doDrag() call. | InteractiveObject | ||
![]() | Dispatched during a drag operation by the InteractiveObject that is specified as the drag initiator in the DragManager.doDrag() call. | InteractiveObject | ||
![]() | Dispatched when the user activates the platform-specific accelerator key combination for a paste operation or selects 'Paste' from the text context menu. | InteractiveObject | ||
![]() | Dispatched when the user lowers an active stylus past the proximity detection threshold of the screen. | InteractiveObject | ||
![]() | Dispatched when the user lifts an active stylus above the proximity detection threshold of the screen. | InteractiveObject | ||
![]() | Dispatched when the user moves an active stylus over the screen while remaining within the proximity detection threshold. | InteractiveObject | ||
![]() | Dispatched when the user moves an active stylus away from this InteractiveObject while remaining within the proximity detection threshold of the screen. | InteractiveObject | ||
![]() | Dispatched when the user moves an active stylus directly above this InteractiveObject while remaining within the proximity detection threshold of the screen. | InteractiveObject | ||
![]() | Dispatched when the user moves an active stylus away from this InteractiveObject and any of its children while remaining within the proximity detection threshold of the screen. | InteractiveObject | ||
![]() | Dispatched when the user moves an active stylus over this InteractiveObject from outside the object's tree of descendents in the display list (while remaining within the proximity detection threshold of the screen). | InteractiveObject | ||
![]() | Dispatched when a user releases the button on the pointing device after the user first pressed the button over an InteractiveObject instance and then moved the pointing device off of the InteractiveObject instance. | InteractiveObject | ||
![]() | Dispatched when a display object is about to be removed from the display list. | DisplayObject | ||
![]() | Dispatched when a display object is about to be removed from the display list, either directly or through the removal of a sub tree in which the display object is contained. | DisplayObject | ||
![]() | [broadcast event] Dispatched when the display list is about to be updated and rendered. | DisplayObject | ||
![]() | Dispatched when a user presses and releases the right button of the user's pointing device over the same InteractiveObject. | InteractiveObject | ||
![]() | Dispatched when a user presses the pointing device button over an InteractiveObject instance. | InteractiveObject | ||
![]() | Dispatched when a user releases the pointing device button over an InteractiveObject instance. | InteractiveObject | ||
![]() | Dispatched when the user moves a pointing device away from an InteractiveObject instance. | InteractiveObject | ||
![]() | Dispatched when the user moves a pointing device over an InteractiveObject instance. | InteractiveObject | ||
![]() | Dispatched when the user activates the platform-specific accelerator key combination for a select all operation or selects 'Select All' from the text context menu. | InteractiveObject | ||
![]() | Dispatched immediately after the soft keyboard is raised. | InteractiveObject | ||
![]() | Dispatched immediately before the soft keyboard is raised. | InteractiveObject | ||
![]() | Dispatched immediately after the soft keyboard is lowered. | InteractiveObject | ||
![]() | Dispatched when the value of the object's tabChildren flag changes. | InteractiveObject | ||
![]() | Dispatched when the object's tabEnabled flag changes. | InteractiveObject | ||
![]() | Dispatched when the value of the object's tabIndex property changes. | InteractiveObject | ||
![]() | Dispatched when a user enters one or more characters of text. | InteractiveObject | ||
![]() | Dispatched when the user first contacts a touch-enabled device (such as touches a finger to a mobile phone or tablet with a touch screen). | InteractiveObject | ||
![]() | Dispatched when the user removes contact with a touch-enabled device (such as lifts a finger off a mobile phone or tablet with a touch screen). | InteractiveObject | ||
![]() | Dispatched when the user touches the device, and is continuously dispatched until the point of contact is removed. | InteractiveObject | ||
![]() | Dispatched when the user moves the point of contact away from InteractiveObject instance on a touch-enabled device (such as drags a finger from one display object to another on a mobile phone or tablet with a touch screen). | InteractiveObject | ||
![]() | Dispatched when the user moves the point of contact over an InteractiveObject instance on a touch-enabled device (such as drags a finger from a point outside a display object to a point over a display object on a mobile phone or tablet with a touch screen). | InteractiveObject | ||
![]() | Dispatched when the user moves the point of contact away from an InteractiveObject instance on a touch-enabled device (such as drags a finger from over a display object to a point outside the display object on a mobile phone or tablet with a touch screen). | InteractiveObject | ||
![]() | Dispatched when the user moves the point of contact over an InteractiveObject instance on a touch-enabled device (such as drags a finger from a point outside a display object to a point over a display object on a mobile phone or tablet with a touch screen). | InteractiveObject | ||
![]() | Dispatched when the user lifts the point of contact over the same InteractiveObject instance on which the contact was initiated on a touch-enabled device (such as presses and releases a finger from a single point over a display object on a mobile phone or tablet with a touch screen). | InteractiveObject |
Styles are either common or associated with a specific theme. If the style is common, it can be used with any theme. If a style is associated with a specific theme, it can only be used if your application uses that theme.
This component uses skins made up of skin parts. Do not set the skin parts directly. The component's skin sets the skin parts.
Skin Part | Description | Defined By | ||
---|---|---|---|---|
closeButton:Button | Required: false Part Type: Static Language Version: ActionScript Product Version: Runtime Versions: , The skin part that defines the appearance of the close icon (a small x in the upper-right corner of the TitleWindow title bar). When clicked, the close icon dispatches a close event. Flex does not close the window automatically. To suport the close icon, you must create a handler for the close event and close the TitleWindow from that event handler. Focus is disabled for this skin part. | TitleWindow | ||
![]() | Required: false Part Type: Static Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 An optional skin part that defines the Group where the content children get pushed into and laid out. | SkinnableContainer | ||
![]() | Required: false Part Type: Static Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 The skin part that defines the appearance of the control bar area of the container. By default, the PanelSkin class defines the control bar area to appear at the bottom of the content area of the Panel container with a grey background. | Panel | ||
moveArea:InteractiveObject | Required: false Part Type: Static Language Version: ActionScript Product Version: Runtime Versions: , The area where the user must click and drag to move the window. By default, the move area is the title bar of the TitleWindow container. To drag the TitleWindow container, click and hold the mouse pointer in the title bar area of the window, then move the mouse. Create a custom skin class to change the move area. | TitleWindow | ||
![]() | Required: false Part Type: Static Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 The skin part that defines the appearance of the title text in the container. | Panel |
To skin the component, implement a skin that defines the following states. Although you must implement all skin states, a skin state can be empty. An empty skin state specifies no changes to the default skin state.
Skin State | Description | Defined By | ||
---|---|---|---|---|
![]() |
Disabled State of the Panel
Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 | Panel | ||
![]() |
Disabled State with ControlBar of the Panel
Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 | Panel | ||
inactive |
Inactive view state used for a TitleWindow
when it, or all of its children, are not in focus.
Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 | TitleWindow | ||
inactiveWithControlBar |
Inactive view state with a control bar visible.
Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 | TitleWindow | ||
![]() |
Normal State of the Panel
Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 | Panel | ||
![]() |
Normal State with ControlBar of the Panel
Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 | Panel |
<?xml version="1.0" encoding="utf-8"?> <!-- Simple custom MXML Spark TitleWindow component. The TitleWindowApp application displays this component. You cannot run it independently. --> <s:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" title="Title Window" x="168" y="86"> <s:layout> <s:VerticalLayout /> </s:layout> <fx:Script> <![CDATA[ import mx.managers.PopUpManager; import mx.controls.Text; // A reference to the TextInput control in which to put the result. public var loginName:Text; // Event handler for the OK button. private function returnName():void { loginName.text="Name entered: " + userName.text; PopUpManager.removePopUp(this); } ]]> </fx:Script> <s:HGroup> <s:Label text="Enter Name: "/> <s:TextInput id="userName" width="100%"/> </s:HGroup> <s:HGroup> <s:Button label="OK" click="returnName();"/> <s:Button label="Cancel" click="PopUpManager.removePopUp(this);"/> </s:HGroup> </s:TitleWindow>
<?xml version="1.0"?> <!-- Main application to demonstrate Halo TitleWindow layout container. --> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx"> <fx:Script> <![CDATA[ import flash.events.Event; import mx.core.IFlexDisplayObject; import mx.managers.PopUpManager; import spark.components.TitleWindow; private var point1:Point = new Point(); // Open the TitleWindow container. // Cast the return value of the createPopUp() method // to SimpleTitleWindowExample, the name of the // component containing the TitleWindow container. private function showWindow():void { var login:SimpleTitleWindowExample = SimpleTitleWindowExample(PopUpManager.createPopUp(this, SimpleTitleWindowExample , true)); // Calculate position of TitleWindow in Application's coordinates. // Position it 25 pixels down and to the right of the Button control. point1.x = 0; point1.y = 0; point1 = myButton.localToGlobal(point1); login.x = point1.x + 25; login.y = point1.y + 25; // Pass a reference to the TextInput control // to the TitleWindow container so that the // TitleWindow container can return data to the main application. login.loginName = returnedName; // Add a close handler for the closeButton login.addEventListener("close", closeHandler); } private function closeHandler(event:Event):void { event.target.removeEventListener("close", closeHandler); PopUpManager.removePopUp(event.target as IFlexDisplayObject); } ]]> </fx:Script> <s:Panel title="TitleWindow Container Example" width="75%" height="75%" horizontalCenter="0" verticalCenter="0"> <s:VGroup left="10" right="10" top="10" bottom="10"> <s:Button id="myButton" label="Click to open the TitleWindow container" click="showWindow();"/> <mx:Text id="returnedName" text="" width="100%" /> </s:VGroup> </s:Panel> </s:Application>
Wed Nov 21 2018, 06:34 AM -08:00