Aha.  Yeah, the text property of a Label needs to be a String.  
Since mx.controls.Spacer is not a String, you are getting the string 
representation of the object:  the "[object Object]" part.

That's the problem, the solution is... a little harder.  You can put 
a dynamic number of space characters into the return string instead 
of the Spacer control, but I'm not sure there's a way to get the 
exact results you want from a single Label object.  You could always 
use 2 labels with a spacer in between.

Doug


--- In flexcoders@yahoogroups.com, "Libby" <[EMAIL PROTECTED]> wrote:
>
> OK, this is what I am trying to do:
> I have a component that extends mx.controls.Label. Its text is set
> dynamically by use of the statement below:
> 
> return title + new mx.controls.Spacer("{width:75%}") + ttlRecs + 
recCount;
> 
> so to use this object above, I have in mxml:
>  <mx:Label text="{ myObj.text }"/>
> 
> What displays on the screen is "Some text"[object Object]"more 
text"
> **** quotes are mine - not displayed***.
> 
> What I want to see on the screen is "Some text  ....big 
space....more
> text"
> 
> So I need to somehow make the output of the Spacer drawing itself 
be
> contained within my text.
> 
> Any help is greatly appreciated.
> 
> Thanks,
> Libby
> 
> 
> 
> --- In flexcoders@yahoogroups.com, "Rob Rusher" <[EMAIL PROTECTED]> 
wrote:
> >
> > Are you talking about binding?
> > 
> > <mx:Label text="{ myObj.labelText }"/>
> > 
> > If your custom object has a String property that you want to 
display
> in a
> > Label, you just reference it by name.
> > 
> > Rob Rusher
> > 
> >  
> > 
> > RIA Consultant
> > 
> > Macromedia Certified Flex Instructor
> > 
> > e:[EMAIL PROTECTED] c:303.885.7044 im:robrusher
> > 
> > blog:http://www.robrusher.com
> > 
> > -----Original Message-----
> > From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
> > Behalf Of Libby
> > Sent: Monday, January 30, 2006 3:22 PM
> > To: flexcoders@yahoogroups.com
> > Subject: [flexcoders] How do you reference an object to get
> attributes for a
> > tag?
> > 
> > I wanna do something like this:
> > <mx:Label text = a dynamic custom object  />
> > 
> > So far I have not hit upon the magic combination through 
research and
> > trial and error : (
> > 
> > Thanks,
> > Libby
> > 
> > 
> > 
> > 
> > 
> > --
> > 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 
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