actionscript 2 - Problem when using Flash AS2 embedFonts = true AND textField.onSetFocus() together -
I am using some strange behavior with AS 2 and fonts in a textField using that createTextField () Is added to the forum. This is for the text field which is basically called the year - and the user can enter one year, right click and the year is accepted, then the textfield is saying back that year. I want it to be always a non-serif font, like Ariel (definitely this can not be difficult!)
What I want to achieve here -
1) When the user clicks the textfield, the word "year" has been cleared and the cursor blows indicating that the text can be entered. 2) When the user clicks right (and the given year is a four digit number), the textfield goes back to say "year" (in Ariel)
my code -
this .createTextField ("ui year", 99, 0, 0, 65, 20); UiYear.type = "Input"; UiYear.antiAliasType = "Advanced"; UiYear.restrict = "0-9"; // var my_fmt: text format = new text format (); My_fmt.font = "Arial"; My_fmt.size = 12; My_fmt.align = "left"; // uiYear.embedFonts = true; UiYear.setTextFormat (my_fmt); UiYear.text = "year"; // uiYear.onSetFocus = function () {if (uiYear.text == "year") {uiYear.text = ""; }} // button_over Re: Release = function () {uiYear.text = "year"; } OK?
I see what this is -
When I click on the text, the word "year" disappears, but the flashing cursor does not appear and I can read text in the textfield Can not enter If I remove the line -
uiYear.embedFonts = true; ... then it works fine, the word "year" disappears and when I click on textField then I can type the number in textField. Therefore embeding fonts prevents focus from setting focus to text field when the onset focus function starts. However now the text I am entering is not Ariel, when I click on the OK button and the word "Year" is changed, it is in a serif font - like Times or something I should not do!
Similarly if I try to embed the font from my library - like I have a new font in my library which I export to ActionScript with Linkedge identifier year_font and my_fmt.font = Click Export for actionscript in the My_Font and Linkage dialog. Then when I click on the textfield, the word year disappears but the textfield can not be edited.
If I just admit that onsetfocus is causing problems and with embedded fonts, which goes better, I have more problems -
- If I The cursor I click on textField now appears after the word "year" as I would expect because I removed the socket focus function that has been removed from that word. If I remove the "year" by pressing backspace 4 times I give it C. I also cause disappearing cursor and I can not enter text. Note that this does not happen while doing a local level test, but there is only one problem in publishing and running in the browser.
- However, if I highlight the word "year" then start typing, I am able to type numbers and if I press the OK button, the word word appears in the correct font. It is astonishing that now no longer behaves in number 1 above - if I press the cursor to remove the word and I can type it again, number 1 appears only for the first time.
Any thoughts?
Thanks
I can not reply to your full request, but I have There is also the experience of TextField when you kill yourself while hitting the backspace, and if you mark the text / mark differently, then do not kill yourself.
It should be a bug, because we did it on FP8 FP9 for this one banner and naturally we generate them with the least common denominator, but this time we actually have to work Given him up in favor of having something! :)
Comments
Post a Comment