There has been some discussion on the RobotLegs AS3 Framework Google Group about the best workflow for launching popups in Flex, so I thought I’d do a quick sample.

The workflow consists of:

  • A Command to launch the popup (via the Flex PopupManager)
  • A Mediator that handles events coming from the popup view component

The popup view component’s Mediator also handles closing of the popup and removes itself from the RobotLegs mediatorMap when it’s no longer required.

Note: I should point out that the source for the SWF below includes only some of the RobotLegs framework source-code. To run the source-code, please download the current version of RobotLegs.

Here’s the SWF and sample code. Feel free to use and abuse, no warranties given or implied. View source

Get Adobe Flash player

View source

Tags: , ,