[flexcoders] Re: Accepting MXML attribute's width in percentage on a custom component

2006-06-23 Thread Angela
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 =

[flexcoders] Re: Accepting MXML attribute's width in percentage on a custom component

2006-06-23 Thread Tim Hoff
You can get the width in pixels if you use measuredWidth instead of width. x = mainCanvas.measuredWidth*.5; -TH --- In flexcoders@yahoogroups.com, 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

Re: [flexcoders] Re: Accepting MXML attribute's width in percentage on a custom component

2006-06-23 Thread Tom Ortega
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

Re: [flexcoders] Re: Accepting MXML attribute's width in percentage on a custom component

2006-06-23 Thread Luís Gustavo Sanabio
I'm using anchors. left=0 right=0 top=0 bottom=0 It works better in some cases. (like resizes). Gustavo 2006/6/23, Tim Hoff [EMAIL PROTECTED]: You can get the width in pixels if you use measuredWidth instead ofwidth.x = mainCanvas.measuredWidth*.5 ;-TH--- In flexcoders@yahoogroups.com, Angela

[flexcoders] Re: Accepting MXML attribute's width in percentage on a custom component

2006-06-23 Thread Tim Hoff
percentHeight and percentWidth. datagridcolumnVar.percentWidth = 25; -TH --- In flexcoders@yahoogroups.com, Tom Ortega [EMAIL PROTECTED] wrote: What about the opposite? Does anyone know of a way to set a width in actionscript to use percentages? i.e.: datagridcolumnVar.width = 25%;