Archive for August 9th, 2007

09
Aug

Determining which server/domain a SWF is hosted on

Here’s a handy tip which can help you when deploying Flex applications on mulitple servers (such as a staging/production server). Basically you can listen for the Application tag to dispatch the applicationComplete event, grab the URL of the SWF using the loaderInfo.url property, and then use the URLUtil.getServerName() method to parse out the server name.

Full code after the jump.

Continue reading ‘Determining which server/domain a SWF is hosted on’

09
Aug

Styling buttons in an Alert control

Here’s a basic example of applying a custom style to an Alert control’s buttons and giving them a nice, rounded effect.

Full code after the jump.

Continue reading ‘Styling buttons in an Alert control’

09
Aug

Dynamically creating ActionScript cue points from FlashVars received from the HTML container

In a previous post, “Creating ActionScript cue points with the VideoDisplay controlEdit”, reader Florian asks how you can set cue points dynamically from FlashVars.

Well, here’s one method of passing a single name/value pair from the HTML template into our Flex application and having Flex parse the string and dynamically add the ActionScript cue points to the VideoDisplay control.

Hope that helps.

Full code after the jump.

Continue reading ‘Dynamically creating ActionScript cue points from FlashVars received from the HTML container’

09
Aug

Rounding a Button control’s corners using the cornerRadius property

A simple example which lets you tweak a Button control’s cornerRadius property using a HSlider control.

Full code after the jump.

Continue reading ‘Rounding a Button control’s corners using the cornerRadius property’