This app works fine for me.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; width="600" 
height="600">

        <mx:Script>
        <![CDATA[

                import mx.controls.Text;
                
                private function doit():void
                {
                        var t:Text = new Text();
                        t.text = "Hello, there";
                        t.selectable = false;
                        addChild(t);
                }

        ]]>
        </mx:Script>

        <mx:Button click="doit()"/>

</mx:Application>

- Gordon
________________________________________
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Daniel 
Tuppeny
Sent: Friday, June 30, 2006 6:39 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Label without size doesn't display

After changing from beta3, the following code doesn't work:
 
   var t:Text = new Text();
   t.text = text;
   t.styleName = "gradeLabel";
   t.selectable = false;
//   t.width = 200;
//   t.height = 100;
   this.addChild(t);
 
inside my chart. Howevever, if I uncomment the width/height lines, it works 
fine. How can I have the width/height calculated based on the text there? If I 
specify sizes like the above, my labels appear in the wrong place (because I'm 
positioning them at the Y co-ord of a line, minus the height, so they appear 
above it).
 
There doesn't seem to be any sort of "autoSize" property, or a 
recalculateSize() method (invalidSize doesn't work).
 
Any ideas?
________________________________________
The information contained in this e-mail and/or any attachments is confidential 
and intended only for the individual(s) to which it is addressed. If you are 
not named as an addressee you must not disclose, copy or take any action in 
reliance of this transmission. This e-mail and its attachments have been 
scanned for viruses by MessageLabs Ltd. 
  

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________
 


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Yahoo! Groups gets a make over. See the new email design.
http://us.click.yahoo.com/XISQkA/lOaOAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~-> 

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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to