<div class="gmail_quote">Hi, <div><br></div><div>I have been facing a strange problem lately. I define the sizes of containers in percentages..</div><div><br></div><div>say for example</div><div><br></div><div>&lt;mx:Canvas width=&quot;50%&quot; height = &quot;50%&quot;&gt;</div>

<div>...</div><div>...</div><div>...</div><div>&lt;/mx:Canvas&gt;</div><div><br></div><div>Now inside this I would want to measure the size of the canvas as it is currently because I have an image.. which might be much bigger than this canvas and I want to scale it down to fit this canvas. </div>

<div><br></div><div>So to do that I will have to measure the size of the canvas and figure out what values to use for scaleX and scaleY for the inside image so that it fits into the canvas.</div><div><br></div><div>To do this.. I have tried accessing the width height of the canvas directly.. which return 0.</div>

<div>I have also tried the function getExplicitOrMeasuredWidth () and getExplicitOrMeasuredHeight() function. they too return 0.</div><div><br></div><div>I have tried canvas.getBounds( canvas.stage); and worked with the rect that is returned.. In some cases this works. But not in all cases. </div>

<div><br></div><div>The issue is this does seems to work fine for 1-2 states but doesnt work for a third one ( the value returned is wrong )</div><div><br></div><div>What I would like to know is .. is there anything I can do to get the current displayed size of the canvas, consistently?</div>

<div><br></div><div>Can someone help pls?</div><div><br></div><div>-- </div></div>Regards,<br>Ganaraj P R<br>