Tag Archive for 'popupmanager'

06
Apr

Centering a pop up window when a Flex application is resized

The following example shows how you can center a pop up window (in this case an Alert control) when the Flex application is resized by using the resize event on the <mx:Application /> tag and using the static PopUpManager.centerPopUp() method.

Full code after the jump.

Continue reading ‘Centering a pop up window when a Flex application is resized’

20
Mar

Creating custom pop-up windows with the PopUpManager class (redux)

In a previous example, “Creating custom pop-up windows with the PopUpManager class”, we saw how you could use ActionScript to create pop up windows using the PopUpManager class in Flex.

In the following example we see how you can create a custom MXML component and pass the class name to the static PopUpManager.createPopUp() method to display the pop up.

Full code after the jump.

Continue reading ‘Creating custom pop-up windows with the PopUpManager class (redux)’

08
Mar

Creating a simple image gallery with the Flex TileList control

Similar to a previous example, “Creating a simple image gallery with the Flex HorizontalList control”, the following example shows how you can create a simple photo gallery in Flex using the TileList control, Image control, and the PopUpManager class.

Full code after the jump.

Continue reading ‘Creating a simple image gallery with the Flex TileList control’

22
Feb

Detecting when a mouse leaves a Flex application

The following example shows how you can detect when the mouse leaves the bounds of a Flex application by listening for the stage object’s mouseLeave event.

Full code after the jump.

Continue reading ‘Detecting when a mouse leaves a Flex application’

27
Jan

Displaying a TextInput control’s text as a password in Flex (redux)

We’ve already seen how to get a TextInput control to display its text as a masked password field before in an earlier example, “Displaying a TextInput control’s text as a password in Flex” by setting the displayAsPassword property to true.
The following example will show you how you can listen for the focusIn and focusOut events to toggle the displayAsPassword property so that when the password field has focus the text is displayed as plain text, and when the password field does not have focus the text is displayed as masked text.

Full code after the jump.

Continue reading ‘Displaying a TextInput control’s text as a password in Flex (redux)’

22
Oct

Programmatically removing an Alert using the PopUpManager

The following example shows how you can close an Alert control by calling the PopUpManager class’s removePopUp() method.

Full code after the jump.

Continue reading ‘Programmatically removing an Alert using the PopUpManager’

18
Oct

Using the Image control as a pop up

The following example shows how you can use the PopUpManager class to launch an modal Image control.

Full code after the jump.

Continue reading ‘Using the Image control as a pop up’

12
Oct

Globally setting modal styles in a Flex application

The topic of setting modal styles came up again today so I thought I’d re-share this tip (I previously covered controlling modal styles for the Alert control in an earlier post, “Changing a modal Alert control’s blur, transparency and transparency color”).

The following example shows how you can set the various modal styles (modalTransparencyBlur, modalTransparency, modalTransparencyColor, and modalTransparencyDuration) on the global selector so it propogates to both the Alert control and pop-ups created using the PopUpManager.

Full code after the jump.

Continue reading ‘Globally setting modal styles in a Flex application’

20
Aug

Creating custom dialog boxes using the PopUpManager and TitleWindow classes

Here are a couple examples of using the TitleWindow container with the PopUpManager class to create custom pop-up windows and dialog boxes.

Full code after the jump.

Continue reading ‘Creating custom dialog boxes using the PopUpManager and TitleWindow classes’

06
Aug

Creating custom pop-up windows with the PopUpManager class

The Alert control is great if you need to get a simple confirmation on an action which has a yes/no type answer, but what do you use when you need to prompt a user for their name or something else? JavaScript has a prompt(), and Flex has a very robust PopUpManager class.

This following example will demonstrate how to launch a custom Panel pop-up dialog which includes a Label control, TextInput control, and two Button controls. It also shows how to create a bunch of Flex components and containers using ActionScript instead of MXML.

Full code after the jump.

Continue reading ‘Creating custom pop-up windows with the PopUpManager class’

06
Aug

Modules and singleton manager classes

This is a bit more of a “gotcha” than a tip, but it is something I’ve run into twice in the past week or so. When working with application domains and singletons (such as the DragManager or PopUpManager). I’ve been playing with modules the past couple days and ran into an issue when trying to drag items from a DataGrid in one module to a DataGrid in the second module. When trying to select an item in one of the data grids, I’d get strange run-time errors. The solution? Create a reference in my main application to a dummy DragManager or PopUpManager instance.

Hopefully this will save somebody a little bit of a headache in the future.

Full code after the jump.

Continue reading ‘Modules and singleton manager classes’