Dynamic Italic Text doesn't work (SOLVED)

Subscribe to Dynamic Italic Text doesn't work (SOLVED) 6 posts

avatar for DrYoshiyahu DrYoshiyahu 678 posts
Flag Post

I have a movieclip with a dynamic textbox with italic font, I created the textbox and italic settings using the editor and not AS3.
In my code when I say

textbox.text = subtitle;

the textbox becomes blank.

I’m not getting any errors and tracing the text shows me exactly what I want it to. But in the swf, there is no text visible.

When I comment out the line; the text that is in the movieclip already – from using the editor and not AS3 – is visible and working.

Without changing the code, I tried the same textbox with regular, bold, and black font, and they all worked. Italic and Bold/Italic did not work.

It is embedded; as well as the same font in regular, bold, and black.

Can anyone help me out? :(
-Yoshiyahu

 
avatar for AMD_Paulius_J AMD_Paulius_J 110 posts
Flag Post

I don’t know if this will help, but i had a similar issue, if I set textbox equal to some variable it becomes blank, solved it like this:

textbox.text = "" + subtitle;

And I still don’t know why is "" mandatory.

 
avatar for DrYoshiyahu DrYoshiyahu 678 posts
Flag Post

That didn’t work, and just for the record, setting the text to a straight string and not a variable doesn’t work either.
I also tried using a different name for the textbox, the variable, and I changed the variable’s string. Still nothing.

 
avatar for vesperbot vesperbot 1883 posts
Flag Post

Embed your font(s), or ust textbox.defaultTextFormat property to set after you set the text.

 
avatar for DrYoshiyahu DrYoshiyahu 678 posts
Flag Post

Thanks, the TextFormat worked, though I don’t understand why it’s necessary if I made the font italic in the editor, or why it only failed to work with italic fonts and not others.

 
avatar for vesperbot vesperbot 1883 posts
Flag Post

I expect that when you design a TextField in Adobe Flash GUI editor, it fills data wrongly, or non-intuitively, it does not fill defaultTextFormat property, but instead applies text formatting to certain segments of initial text, which all get dropped when you assign different text value to a TextField.