Thanks, all.

I called:
myLabel.validateNow()

and declared a handler on the myLabel.resize event, did my event logic in
there, and all seems to be working fine.



Tracy Spratt,
Lariat Services, development services available

-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Manish Jethani
Sent: Wednesday, May 27, 2009 10:02 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Cause Label to resize after setting text

On Wed, May 27, 2009 at 9:17 AM, Tracy Spratt <tr...@nts3rd.com> wrote:

[...]

>
> When a setter function sets the Label’s text property, the label has not
> been resized to fit the new text yet, so I can’t test:
>
> if (myLabel.width > this.width)
>
> in the setter
>

> I have not yet found the right invalidation, or event or override to
trigger
> my measure logic.  Any suggestions?

You should try calling validateNow() on the Label object.

Either that, or call your own invalidateDisplayList() and let
updateDisplayList() take care of triggering the effect.

  public function set marqueeText(value:String):void
  {
      if (label.text != value) {
          label.text = value;

          invalidateDisplayList();
      }
  }

  override protected function updateDisplayList(...):void
  {
    // do the effect here if necessary
  }

Manish

-- 
www.manishjethani.com


------------------------------------

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Alternative FAQ location:
https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62
079f6847
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links





Reply via email to