A Paritosh Bisi's Blog

On Rich Internet Applications, Adobe Flex, ActionScript, Web Technologies and more…

Problem with Flex ‘Module’ – Percentages for height and width

Posted by Paritosh Bisi on August 30, 2009

Recently while working with Flex Modules I came across an interesting find. Whenever I was setting the module’s height and width to “100%”, it was simply ignoring. So after googling a lot I came across the following tech note from adobe.

http://www.adobe.com/support/documentation/en/flex/2/releasenotes_flex201_sdk.html

Here it is clearly noted that, “Module ignores percentages for width/height, always sizing to content”. And the work around for this is to add percentWidth="100" percentHeight="100" instead of height=”100%” width=”100%”.

Example:

<mx:Module xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" percentWidth="100" percentHeight="100">

So, while developing modules, whenever we need to set height and width to 100 percentages, we need to carefully implement like above.

Happy Flexing :-)

2 Responses to “Problem with Flex ‘Module’ – Percentages for height and width”

  1. Nikos said

    This doesn’t work in flex 3.4 :(

  2. [...] http://paritoshbisi.wordpress.com/2009/08/30/problem-with-flex-module-percentages-for-height-and-wid… [...]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.