History | Log In     View a printable version of the current page.  
Issue Details (XML)

Key: FP-777
Type: Bug Bug
Status: In Progress In Progress
Priority: None None
Assignee: Trevor McCauley
Reporter: Oscar Berg
Votes: 22
Watchers: 17
Operations

If you were logged in you would be able to see more operations.
Flash Player

Flash Player 10 TextField.autoSize issue

Created: 10/17/08 06:52 AM   Updated: 06/16/09 03:38 AM
Component/s: Text Properties/Format
Security Level: Public (All JIRA Users )

File Attachments: 1. File BugDemo.fla (54 kb)
2. File BugSquish.fla (40 kb)
3. File BugSquishLite.fla (58 kb)
4. File LetsFindABug.as (2 kb)

Image Attachments:

1. Bug Shot 2.jpg
(97 kb)

2. Bug Shot.jpg
(109 kb)

3. screenshot-1.jpg
(366 kb)
Issue Links:
Relationship
 
This issue is related to by:
FP-928 AS2 Textfield autosize None Resolved

Severity: Incorrectly Functioning
Reproducibility: Every Time
Discoverability: High
Found in Version: Flash Player 10 - 10_0_12_36
Affected OS(s): Windows - XP
Injection: Yes
Steps to Reproduce:
Im working on a an ageing AS2 website (www.gamarena.com), and when I installed Flash Player 10 I noticed that some text fields are not correctly autosized. They get cut. All textfields are are populated through the same method with the same dynamically loaded fonts.

Steps to reproduce:
1. Go to www.gamarena.com
2. Look at the top menu and notice missing chars. (ex. COMMUNITY reads COMMUNIT)
3. Change locale at the right corner of the registration bar and notice how the text fields are resizeing in a seemingly random way. The actual length of the word does not seem to affect if it works or not.
 
 Actual Results:
 see above.
 
 Expected Results:
The text fields should autosize correctly.
  
 Workaround (if any):
 
 
Language Found: English
Bugbase Id: 1932320
Triaged: Yes
Participants: Charles Liss, Choi, Junegunn, Chris, Clayton Graul, Curtiss Patrick, David Ostermann, Erwin Verdonk, Jan Verstreken, Jigman, John Donohoe, Kirit Tanna, Nathan, Oscar Berg, Paul, Ryan Kachik, Trevor McCauley, Uli Metic and z


 All   Comments      Sort Order:
Paul - [10/27/08 10:15 AM ]
I am seeing the same issue with some text fields that are within movieclips that are meant to be clickable...

Paul - [10/27/08 10:18 AM ]
Notice in the windows...those are supposed to be full email addresses and web link...instead they are cut off half way through the first letter...

Paul - [10/29/08 09:16 AM ]
This is the same text string for both textFields...in one it appears screwed up...in the other...its fine...this time the autoSize is not the issue...because autoSize is turned off for both textFields...the blue text field is multiline the white text field is single line...any help?/?

Charles Liss - [10/30/08 02:03 PM ]
Would you be willing to provide me answers to a few questions? Are these text fields part of a AS2 compiled swf? Where does the data in these fields get populated. In the screen shots you attached. How do I get to that page?

Paul - [10/30/08 03:27 PM ]
The textfields in the Screen shots are part of an AS2.0 compiled swf...the data is read in from XML into arrays upon load...upon certain user interaction there are popup MCs that appear on stage...these contain the textFields in question...the textFields are MCs within these popup MCs..then populated using AS code in the actions frame of the popup MC....for example emailMC.emailText.text = _root.someArray[x];

You can view this in action...click a booth on stage...and you will see the screw ups...the e-mail and web fields in both the available booth popup, and the rented booth popup are both autoSize = true; multiline = false; and I also put border and background to true...in the profile and category sections of the rented booth popup...the text fields are set to autoSize but their multiline feature is set to true...

http://www.expocad.com/fx1.2a/default.html

Choi, Junegunn - [11/16/08 09:41 AM ]
I'm having the same problem, the difference is that my project is built using Flex Builder 2, with actionscript 3. My code goes,

var tf:TextField = new TextField();
... ...
tf.autoSize = TextFieldAutoSize.LEFT;
tf.htmlText = "some text ...";

It worked fine on Flash player 9, but "not always" on 10. Some TextFields are clipped. One workaround I've found - albeit not perfect - is to disable auto-sizing attribute after setting the text.

var tf:TextField = new TextField();
... ...
tf.autoSize = TextFieldAutoSize.LEFT;
tf.htmlText = "some text ...";
tf.autoSize = TextFieldAutoSize.NONE;

Then most of the clippings (except some minor ones) are gone.

Nathan - [11/17/08 12:04 PM ]
Our application was having the exact same bug. It is definitely a Flash 10 error as the issue never occurred prior to updating. After a good chunk of testing I was able to determine that when autosize was set to true the textfield was allocating exactly 8 pixels less than the text to be used needed. Below is the function when this bug was occuring (I was able to code a workaround) and so far this is the only project where this issue popped up (all of our text fields are autosized). The offending application can be found at http://www.bryant.edu/wps/wcmresources/tour/ . The two buttons affected were the ones with the text "CAMPUS MAP" and "CHOOSE A TOUR". We have passed along a fixed swf to the client so I do not know if you will see the Kludge or the original.

//Text field oddity\\
private function makeButton(mcClip:MovieClip, sLabel:String, sID:String):Void
{
mcClip.createEmptyMovieClip("_mcBackground", mcClip.getNextHighestDepth());
mcClip.createTextField("_txt", mcClip.getNextHighestDepth(), 0, 0, 0, 0);

mcClip._txt.text = sLabel;
mcClip._txt.autoSize = true;
mcClip._txt.embedFonts = true;
mcClip._txt.selectable = false;
mcClip._txt.antiAliasType = "advanced";

       //setButtonText creates a TextFormat object of "frontViewSelectorFontColor" color and applies it to the mcClip._txt textfield.
setButtonText(mcClip._txt, _global.oSettings.getSetting("frontViewSelectorFontColor"));

        //START Kludge
var nTextW:Number = mcClip._txt._width;
nTextW = mcClip._txt._width;

var nTextH:Number = mcClip._txt._height;
nTextH = mcClip._txt._height;

mcClip._txt.autoSize = false;
mcClip._txt._width = nTextW + 8;
mcClip._txt._height = nTextH;
         //END Kludge
}

z - [11/26/08 12:20 AM ]
Me too, i had this problem when i upgraded to Flash Player 10. I did everything but nothing seems to fix it.
What I did was downgraded to Flash Player 9 and informed my ALL client NOT to get Flash Player 10.
I simply dont get it... how could they release a player with a very obvious BUG... dont they have any QA on this?
or any QA at all ?
Tons of text effects they say... whats the use of text effects if the text is broken LOL

Clayton Graul - [12/01/08 02:04 PM ]
I have the same issue using amfphp for delivery. I would have to say this is an urgent issue. If Charles Liss needs any information to help resolve this issue I'd be more then willing to offer it up. Our user base of 10.0 flash users has grown to 40%. This is effecting our business.

Trevor McCauley - [12/01/08 06:36 PM ]
Does anyone have simple, reproducible code they can share? I'm not able to easily reproduce the issue, plus www.gamarena.com seems to be fixed and http://www.expocad.com/fx1.2a/default.html is 404. Thanks.

Nathan - [12/02/08 11:42 AM ]
Trevor,

Below is a reduced version of where I was experiencing the error. I created a new .fla specifically to test it and was able to reproduce the bug. Now granted this new test .fla cannot simulate the complexity of nested movieClips in the actual application which was having the bug, but this is good as it shows the bug at its most basic/uncluttered form.

What you will see when you launch the link below is two "buttons" (plain text fields because I'm lazy). Their text should read:
_mcButtonOne = "I AM THE ALL POWERFUL BUTTON ONE"
_mcButtonTwo = "I HATE BUTTON ONE"

Notice that in ButtonOne the "E" is cut-off and in ButtonTwo the "NE" is clipped.

Link to Bug:
http://www.layingthegroundwork.com/AnyTour/BugSquish.html

//Code in BugSquish.fla first frame\\
createEmptyMovieClip("_mcMain", getNextHighestDepth());

var oInit:Object = {target:_mcMain};
var acBug:LetsFindABug = new LetsFindABug(oInit);
// End Fla Code\\

// Begin Class "LetsFindABug.as"\\
class LetsFindABug
{
private var _target:MovieClip;

function LetsFindABug(oInit:Object)
{
for (var sProp:String in oInit)
{
var value = oInit[sProp];

if (value != undefined)
{
this["_"+sProp] = value;
}
}

createClipTree();
drawButtons();
}

private function createClipTree():Void
{
_target.createEmptyMovieClip("_mcButtonOne", _target.getNextHighestDepth());
_target.createEmptyMovieClip("_mcButtonTwo", _target.getNextHighestDepth());
}

private function drawButtons():Void
{
makeButton(_target._mcButtonOne, "I AM THE ALL POWERFUL BUTTON ONE");

_target._mcButtonTwo._x = _target._mcButtonOne._width + 10;

makeButton(_target._mcButtonTwo, "I HATE BUTTON ONE");
}

private function makeButton(mcClip:MovieClip, sLabel:String):Void
{
mcClip.createEmptyMovieClip("_mcBackground", mcClip.getNextHighestDepth());
mcClip.createTextField("_txt", mcClip.getNextHighestDepth(), 0, 0, 0, 0);

mcClip._txt.text = sLabel;
mcClip._txt.autoSize = true;
mcClip._txt.embedFonts = true;
mcClip._txt.selectable = false;
mcClip._txt.antiAliasType = "advanced";

//setButtonText creates a TextFormat object of "frontViewSelectorFontColor" color and applies it to the mcClip._txt textfield.
var nColor:Number = 0x000000;
setButtonText(mcClip._txt, nColor);
}

private function setButtonText(txtClip:TextField, nColor:Number):Void
{
var oFomt:TextFormat = new TextFormat();
                        //"Arial_embed" is an embedded font located in the library of typeface Arial
oFomt.font = "Arial_embed";
oFomt.size = 10;
oFomt.color = nColor;
txtClip.setTextFormat(oFomt);
}
}

Nathan - [12/02/08 11:47 AM ]
Attached the files I referenced in my previous comment.

Trevor McCauley - [12/02/08 03:42 PM - edited ]
Thanks Nathan!
I've reduced the code to the following (with the inclusion of the embedded Arial_embed font in the library):

with (createTextField("tf", 0, 0, 0, 0, 0)){
antiAliasType = "advanced";
autoSize = true;
embedFonts = true;
text = "BUTTON ONE";
setTextFormat(new TextFormat("Arial_embed", 10));
}

Each of those properties must be set for the bug to be reproduced. Additionally the result is inconsistent based on the text used. Very few iterations of the text provided demonstrated clipping. The shortest I could find was "BUTTON ONE", though I'm sure other strings would also cause it to occur. The inconsistency could make this a little tricky but we'll definitely look into it.

[Edit]
The results above actually only apply to Flash Authoring. Different results are visible in the current web player which is in fact a later version than that which ships with CS4.

Nathan - [12/02/08 05:57 PM ]
Trevor,
I created two new Swfs using your syntax. They are:
http://www.layingthegroundwork.com/AnyTour/BugSquishLite.html
http://www.layingthegroundwork.com/AnyTour/BugDemo.html

I noticed your implementation varied in a few ways. First you hard coded a depth value for the textfield. Second the textField was not a child of a movieClip. Third there was only one text field present. None of these should have any significance, but then again this bug seems to have more permutations than the common cold. In neither SWF was the bug encountered again.

 SWF breakdown:
BugSquishLite has four lines of buttons. First line is two implementations of your syntax. Second line each textfield is created with getNextHighestDepth(). Third line the textFields are children of a created clip "_mcMain" depth is hard coded. Line four textFields are children of _mcMainTwo and depth is generated via getNextHighesdepth(). I was surprised to see the bug not occur as line four is functionally the same as my first SWF created earlier today. Bizarre indeed.

BugDemo is just a utility to attempt and find certain strings that would create the bug. First line is your syntax second line is the same syntax as line four from SquishLite. I cannot find any string to cause the bug.

Both .fla files are attached for reference. I am using CS3 thus my only way to test FP10 issues is via a web browser.

Jigman - [12/09/08 12:23 PM ]
Hi,

I was able to find a work around for this bug.
basically you set up your textfield, then enter an empty text for the textfield... then at the last step, enter the actual text for your textfield.

var textfield = new TextField();
textfield.autoSize = "left"
textfield.multiline = ...
...
...
textfield.htmlText = ''; // note: empty string

...
...
textfield.htmlText = "Now this will work." // now enter your actual string here

Hope this helps.

Ryan Kachik - [12/19/08 09:05 AM ]
I have found this issue as well.

I recently upgraded to FP10, and my old project was Flex 3/AS3 and the text fields are all strange. I am experiencing the same "cutoff" mentioned here, but I am also getting unnecessary line breaks.

Moderators, I believe this issue is related to the issue I submitted earlier last month: FP-1051, http://bugs.adobe.com/jira/browse/FP-1051. The only difference being, I used the Text component in Flex, but it appears to be a TextField problem.

Uli Metic - [02/25/09 09:55 AM ]
Could we get an update? This has broken a lot of stuff here and we can't all recode in AS3 just because, please update us !

Erwin Verdonk - [03/17/09 03:40 AM ]
Here we also have the same problem. Lots of texts that are auto sized are cut off, which affects a lot of our components and thus also the satisfaction of our customers. This started since Flash Player 10. We are using Flex 3.2 SDK but have also replicated the issue within Flash Authoring. We are hoping Adobe will fix this asap!

Curtiss Patrick - [03/30/09 11:32 AM ]
Here's a quick way to fix this problem:

myTextField.autoSize = "center";
myTextField.width = myTextField.width+5;

Jan Verstreken - [04/07/09 04:29 AM ]
This is one nasty little bug. I spent hours trying to find a workaround, including all of them stated above.
Changing the anti-alias from anti-alias for readability to anti-alias for animation solved the problem for me.

I had the problem with a font that was already embedded in the library (because it s dynamically assigned to dynamically created textfields in the project). Other fonts worked just fine.

Erwin Verdonk - [04/24/09 06:31 AM ]
Adobe, can you please provide us with an update on this issue? It is a pretty big issue and I feel like we are kept in the dark here.

John Donohoe - [04/28/09 06:58 PM ]
FP 10 vs FP 9 using ActionScript 3. Compiled in Flash CS4 for FP 9.

I'm using a MovieClip with a dynamic TextField on its stage having about 90 glyphs or so embedded. I then script the TextFields dynamically at run time. I tried Jan Verstreken's workaround to no avail. Switching the dynamic TextField within the MovieClip to have an anti-alias type for animation did nothing. The magenta border is visible because I specified to show the border of the TextField to illustrate the clipping effect.

These TextFields do not explicitly set autoSize. Also, note that the first chat bubble TextField appears fine. But after a tween to scaleX & Y to 0, then tween to scaleX & Y of 1, the discrepancy results in FP 10. All resulting TextFields show the first line, cut off at it's specified width, and show the last word of the populated htmlText for the TextField.

Hope this helps, Adobe. Please fix asap.

Special thanks for making the Creative Suite CS4 software. What beautiful software.

Cheers!

Chris - [05/27/09 01:50 PM ]
I discovered this same bug after completely ruling out my own code as an issue.

The only fix I found was to increase the margin (right side) by as much as 7 pixels. This seems to let the character being cut off display completely.

I don't like this fix it would be much nicer to simply have autosize include all the characters with no cut off.

David Ostermann - [06/15/09 09:05 AM ]
I have the same problem that I see in screeshots above. The probleme appear only on firefox. The problem appear when i set width and autoSize(left in my case) in a same multiline textfield. I fixed it setting autoSize to TextFieldAutoSize.NONE.

Cheers,

David.

Kirit Tanna - [06/16/09 03:38 AM ]
Thanks Jigman! You workaround (http://bugs.adobe.com/jira/browse/FP-777#action_219483) worked for me :)
Hope Adobe fixes this ASAP because so many applications depend on this feature for menus, positioning etc.