Category Archives: Application

Grabbing FlashVars from the embedding HTML template in Flex 4 (SWFObject Edition)

In a previous entry, “Grabbing FlashVars from the embedding HTML template”, we saw how you could access FlashVars in your Flex application by passing a name/value pair string to the AC_FL_RunContent() method and <object>/<embed> tags from your HTML template.

The following example shows how you can pass FlashVars from your HTML template to your Flex applications using the Flex 4 SDK (which uses SWFObject now, by the way).

Full code after the jump.

Continue reading Grabbing FlashVars from the embedding HTML template in Flex 4 (SWFObject Edition)

Disabling user input in a Flex Application

I’ve seen this come up a few times in various lists, and figured maybe somebody out there may find this useful.

The following example shows how you can prevent user input in a Flex application by setting the enabled property to false in the <mx:Application /> tag, or by setting the Application.application.enabled property.

Any suggestions? Leave them in the comments!

Full code after the jump.

Continue reading Disabling user input in a Flex Application

Setting a Flex application’s style name

The following example shows how you can use the styleName style in a Flex Application to remove the background image, set the background color to white and left aligns the content.

To quote the Flex 2.0.1 documentation, “Overriding the default Application container styles“:

The Flex default style sheet defines a plain style name that sets all padding to 0 pixels, removes the default background image, sets the background color to white, and left-aligns the children.

Full code after the jump.

Continue reading Setting a Flex application’s style name