From: http://www.webstudio.com.cn/blog? P = 68
Too handsome. I couldn't think of Thank Goodness that helped me find a solution to the problem of _ rotation and _ alpha unavailability at midnight!
When creating text dynamically, you will always encounter the problem of embedding fonts. The most common problem is the link ID.
Generally, you need to create a new font in the library. For example, you can select the o4b_08 font and name the base name 04b_08, so that the font can be created. But one step is always easy to forget. We also need to select the font in the library, right-click the link, and select export as the Action Script. The name is also named o4b_08. In this way, you can successfully embed the dynamically created text in the font. Then add the Code:
This. createTextField ("my_text", this. Fig (), 100,100,300,100 );
My_text.text = "welcome to egoldy flashblog ";
Var my_fmt: TextFormat = new TextFormat ();
My_fmt.color = 0xff0000;
My_fmt.align = "center ";
My_fmt.size = 8;
My_fmt.font = "04b_08 ";
My_text.setTextFormat (my_fmt );
My_text.embedFonts = true;
//*****************************
My_text. _ alpha = 50;
My_text. _ rotation = 90;
//*****************************
You may already know the reason for adding the * line. When we do not use the embedded font method, these two lines will not take effect in any way, which is also the reason why I have encountered problems more or less. If you use the above method to embed the font. You will find that these two lines can take effect. You can add other attributes to the dynamically created font.
Btw: I used a variety of fonts for the test, and the size of the result file has increased a lot. If you use Chinese, it will be larger. It is estimated that the problem may have been solved by flash 8 ball.