开发者

AS3 Text only displays if I rapidly double clicks on the text field

I have added a menu to my game, and now certain text for the game does not appear unless I quickly double click the text field. Everything non-text works.

theSidebar is an i开发者_StackOverflow中文版nstance of Sidebar movieclip which has two text fields that I added in the flash IDE, both with correct instance names.

I have embedded my fonts, and tracing the text of the textField gives the correct number, without any return lines or whitespaces.

The "double click shows text" is only for my countdown time. My other score text field does not display no matter what, not even the text I set in the flash IDE.

The only thing I can think of why is maybe flash stops rendering it because I have another menu movieclip that I set the alpha to 0 on stage that might overlay the text fields, however removing the menu movieclip does not fix the problem.

Right clicking on the text field, select all, copy, paste gives the correct number.

EDIT: Here's the fla + as files with only the code for the text fields: http://dl.dropbox.com/u/11915745/example.zip


Option #1: Chars not showing as they are not embedded (Who knows what you might have embedded)

Click on the textfield, then go to it's properties screen (CTRL-F3) and then find the "embed..." button or similar. It should open up the embed window which allows you to embed font characters directly into the .swf

Embed the numbers, the : (double colon) or whatever other chars you use and then recompile.

If you are using CS5 or CS5.5, switch from TLF textfields to "classic" just in case, I've never used the newer ones so I don't know if they have some quirks.

Remmeber that embedding of charaters is font wide, that is, all characters you need are SHARED between all textfields that use that font. So if TF A is using numbers and TF B is using letters, you need to embed both numbers and letters in either one of the textfields and it will "propagate" to the other one since it is font specific, not textfield specific.

Option #2:

trace("textfield alpha is: "+textfieldXYZ.alpha);

or it's parrent alpha is 0...

Option #3: on the properties screen (CTRL-3 once TF is selected) for the textfield, check it's text color (you can also check it's alpha here)...

Option #4: check for stupid things in your code like textfield.alpha = 0; of textfield.textColor = 0x000000; that can fail... (do a CTRL+F search for "textfieldrefname" and find every reference to it and see whether you broke something)

Looking at your question again, you mangled your textColor probably... either in the properties screne or in code...

Option #5: Ah yes, sometimes if the field is too small it can fail to show if I remember correctly (width and height)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜