[FONT=Times New Roman][SIZE=3]Hi all,[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]I’m pretty new to Flash, but form the start I have a big struggle with coding. Hope some smart, experienced flash coder can help me with that.[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]I want to create an empty text box in the actionScript. Then I want to pass a variable to it, and set up its alpha to 50% (I embedded the Verdana font and linkage it to actionScript).[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]This is my code:[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
[SIZE=3][FONT=Courier New]var myTxt:String=“Łódź, Poznań; Moscow:Москва; Minsk: Мінск”;[/FONT][/SIZE]
[FONT=Courier New][SIZE=3] [/SIZE][/FONT]
[SIZE=3][FONT=Courier New]var txt_fmt:TextFormat = new TextFormat();[/FONT][/SIZE]
[SIZE=3][FONT=Courier New]txt_fmt.font = “myFont”;[/FONT][/SIZE]
[SIZE=3][FONT=Courier New]txt_fmt.size = 24;[/FONT][/SIZE]
[SIZE=3][FONT=Courier New]txt_fmt.color = 0xBF0000;[/FONT][/SIZE]
[FONT=Courier New][SIZE=3] [/SIZE][/FONT]
[SIZE=3][FONT=Courier New]this.createTextField(“city_txt”, this.getNextHighestDepth(), 25, 5, 200, 40);[/FONT][/SIZE]
[SIZE=3][FONT=Courier New]city_txt.type = “dynamic”;[/FONT][/SIZE]
[SIZE=3][FONT=Courier New]city_txt.embedFonts=true;[/FONT][/SIZE]
[SIZE=3][FONT=Courier New]city_txt.setNewTextFormat(txt_fmt);[/FONT][/SIZE]
[SIZE=3][FONT=Courier New]city_txt.text = myTxt;[/FONT][/SIZE]
[FONT=Courier New][SIZE=3] [/SIZE][/FONT]
[FONT=Courier New][SIZE=3]city_txt._alpha=50;[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]My problem is that it doesn’t want to display special characters like Polish or Russian letters. I know, that it is possible to embed characters, but I guess it is only possible to the text elements placed on the stage, and I need to create this text box dynamically in the code.[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]I tried to change the font into: Arial CYR, but still nothing. What I managed to discover so far is, if the line: “city_txt.embedFonts=true;” is removed, than everything is displayed correctly but than I can’t see my alpha. [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]