What about the opposite?  Does anyone know of a way to set a width in actionscript to use percentages? i.e.:

datagridcolumnVar.width = 25%;

won't work.

On 6/23/06, Angela <[EMAIL PROTECTED]> wrote:

I am actually having the same problem -

I have a canvas with the width set to 100%. If I try and get the
width in pixels through AS it returns 0.

If I try the same thing through mxml it works fine.

So this in AS:
public function getMiddle():Number {
var x:Number;
x = mainCanvas.width*.5;
return x;
}

--returns 0

in MXML:
<mx:Label text="{mainCanvas.width*.5}"/>

--returns the amount in pixels.

Anyone out there know how to get the pixel value though AS?

Angela.



--- In [email protected], "leo4beer" <[EMAIL PROTECTED]> wrote:
>
> Accepting MXML attribute's width in percentage in a custom component
>
> Hi, I have a component I've created by inheriting UIObject class
>
> In my mxml I have the following lines used for initiating my
component:
>
> <my:comp width="400"….
>
> In my AS code I can trace the value of __width, in this case the
> result will be "400".
>
> My problem is that when I set the value as percentage:
>
> <my:comp width="100%"….
>
> In this case the value of __width is "undefined"
>
> What should I do in order to get the correct value when setting the
> width in percentage and not in pixels??
>
> Thanks
>


__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to