Trouble with formattedWidth revisited

Scott Rossi scott at tactilemedia.com
Thu Apr 6 18:04:01 EDT 2006


Recently, Graham Samuel wrote:

>> The RR docs says:
>> 
>>> If you specify a field, the formattedWidth reports the width
>>> required by the field's text.
>> 
>> Well, for me sometimes it does, and sometimes it doesn't. When it
>> doesn't, the formattedWidth reports zero.
> 
> So far the only way I can get it to work is by going to the card with
> the field on it before doing the formattedWidth test (which seems to
> suggest it only works on 'this card'), but that's something I
> certainly don't want to do. The relevant stack is open, and I had no
> difficulty writing to the field.
> 
> It's got to be something I'm doing wrong, but I simply can't work out
> what it is.


The problem is, as you already found, that the formattedWidth/Height doesn't
work for field on a card that isn't open.  For whatever reason, the card on
which the field lies must be opened to return a real value.  The field or
stack can be hidden, but the the field still must reside on the current
card.

Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia & Design
-----
E: scott at tactilemedia.com
W: http://www.tactilemedia.com




More information about the use-livecode mailing list