Today, we use Flash CS 5.5 (IDE) to do an experiment on fonts. The Code is as follows:
import flash.text.Font;import flash.text.TextField;import flash.text.TextFormat;import flash.text.TextFormatAlign;import flash.text.TextFieldAutoSize;import flash.display.StageAlign;import flash.display.StageScaleMode;stage.align = StageAlign.TOP_LEFT;stage.scaleMode = StageScaleMode.NO_SCALE;var fonts:Array = Font.enumerateFonts(true);fonts.sortOn('fontName', Array.CASEINSENSITIVE);var font:Font;var offsetX:int = 0;var offsetY:int = 0;while (font=fonts.shift()){var t:TextField = new TextField();var tf:TextFormat = new TextFormat(font.fontName,16);t.autoSize = TextFieldAutoSize.LEFT;t.defaultTextFormat = tf;t.selectable = false;t.text = font.fontName;t.x = offsetX;t.y = offsetY;addChild(t);offsetY += t.height;if (offsetY > 600){offsetX += 150;offsetY = 0;}trace([font.fontName, font.fontStyle, font.fontType].join());}
The purpose is to list all fonts in the client system, but a problem occurs during initial release, that is, all text bodies do not take effect.
I switched to flashdevelop (FD) and released it. There is no problem. The difference is that the version number is different. The FD version is 10.1, And the IDE version is 10.2, therefore, the IDE release version is changed to 10.1 to solve the problem.
Later I found that it may be a problem with the SDK. It is okay to release any version of FD with 3.5 and 4.1, but it cannot be released with SDK 4.5.1. I suspect this bug also exists in SDK 4.5.1.
This should be a very old bug. I don't know why this problem is reproduced in the new version... I hope adobe will update and fix this bug as soon as possible.