_width may not be set until after measure() if you didn't set it explicitly.  I don't remember what we have in 1.5, look into using something like _measuredWidth instead?

Matt

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of leo4beer
Sent: Sunday, May 07, 2006 1:19 AM
To: [email protected]
Subject: [flexcoders] Dynamically scaling a custom component

Hi, I have the following class structure:

Class Map extends UIComponent

the class creates an instance of the following class:

Class MapMainView extends UIComponent

In MXML I have the following code:

<my:Map width="400" height="300"></my:Map>

In Map I have the following code:

function createChildren():Void {
            .
            .
            createClassObject(MapMainView,"mmv ",99);
            mmv._width = 400;
            mmv._height = 300;

Then in MapMainView I'm trying to draw a border according to the
component's size...

First get the current size:

function measure():Void{
           
            super.measure();
            MapMainViewAreaWidth = _width � 20
            gridAreaAreaHeight = _height -20
      }

Later, under draw I'm using the drawing API to draw the border:

Function Draw(){
.
lineTo(20, MapMainViewAreaWidth)
      .
}

It seems like _with is null and I'm unable to draw the border

Any ideas?

Thanks in advance,
Leo.







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









--
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