Home > Flex 4 > Resizable TitleWindow in Flex 4

Resizable TitleWindow in Flex 4

January 10th, 2010 Leave a comment Go to comments

The spark TitleWindow allows you to drag it around the stage through the use of a skin part called “moveArea”. By attaching mouse handlers to the moveArea, the TitleWindow can be dragged around the screen. In a similar fashion, we can add another skin part called “resizeHandle” to allow the TitleWindow to be resizable.

To do this, we will subclass TitleWindow and implement mouse handlers that are attached to the new resizeHandle skin part. These mouse handlers change the width and height of the window as the user drags the skin part.

Here is a simple example of this resizable TitleWindow:

View Source

In this example we add the mouseMove and mouseUp Handlers to the systemManager’s sandboxRoot to ensure we are able to drag over sub applications that are compiled with different versions of Flex. Read more about this at the “Marshall Plan” spec.

Note: This sample requires Flex SDK 4.0.0.13266 or higher. You can get the latest SDK builds from opensource.adobe.com.

  1. January 11th, 2010 at 10:25 | #1

    Awesome! Thanks, this really helps a lot, I’m sure everyone needs a component like this at some point :)

  2. January 19th, 2010 at 12:36 | #2

    @TK Thanks for the feedback! =)

  1. No trackbacks yet.