Strangely, the TextField.textWidth property returns different values on
different systems. 

On WIN IE v6.0.2900 Service Pack 2 with Flash Player Version 8,0,24
textWidth is consistently larger than on WIN IE v6.0.2800 Service Pack 1
with Flash Player 8,0,22.

Are the different values of textWidth the result of different IE/Service
Pack versions, or the result of different Flash Player minor versions? 



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Van De
Velde Hans
Sent: Friday, December 22, 2006 5:56 AM
To: 'Flashcoders mailing list'
Subject: RE: [Flashcoders] Measuring width of some text

Just a txt.textWidth should do the trick


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Perdue,
Blake
Sent: donderdag 21 december 2006 22:28
To: [email protected]
Subject: [Flashcoders] Measuring width of some text


I need to measure the width of some text. Here's the function I'm using:

 

private function getTextWidth(txt,fontSize) {

var fmt=new TextFormat();

            fmt.font='Univers 67 CondensedBold';

            fmt.size=fontSize;

            fmt.autoSize='left';

            var metrics=fmt.getTextExtent(txt);

            return metrics.textFieldWidth;

}

 

This function is not predictable - for the same text, it returns
different
numbers on different OSes or flash player versions:

-          works fine in IE/FF for flash player 6

-          doesn't work in Mac Safari for flash player 6

-          works fine in IE/FF for flash player 8 using Service Pack 1

-          doesn't work for IE/FF for flash player 8 using Service Pack
2

 

Is there another function I can use, or another way to go about
measuring
the width of some text?

 

Blake Perdue | 212.522.1292 | AIM: blakepCNN

 

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to