flash actionscript:
Hi... 1-) how can i rotate a text field which is dynamically created during run time ?! 2-) How do I add images to a combo box ?! I mean like icon images to each row .
#1 - embed the font oulines for your chosen font test.embedFonts = true; test.text = "abcd"; myFormat = new TextFormat(); myFormat.font="web"; // Linkage ID of your font myFormat.size = 52; test.setTextFormat(myFormat); #2 - an MX6 test file - http://www.jackleaman.co.uk/flash/istbox_combo_icon2.swf hth
One way I've found for getting instance names of dynamically created components (so you can access/change their properties) is by testing the movie, then opening Debug-->List Objects. Dig through this and you'll find the instance name flash assigns to the dynamically created component; you can then use this instance name in your code to set rotation, etc.
about the first problem... i have done this previously ... embedFonts = true.. but did not work... the only difference between my code and yours is : myFormat.font="web"; // Linkage ID of your font this is not working : this.createTextField("text_txt",22,50,50,50,50); text_txt.embedFonts = true; text_txt = "whatever";
open the Library, from the Options dropdown, select New Font. Select your font and name it. Press OK. Select the New Font, right-click for Linkage. Export for ActionScript, and add your Linkage ID. i used "web" on Frame#1 this.createTextField("test",1,250,10,50,400); test.text = "abcdefghijklmnopqrstuvwxyz0123456789"; test.border = true; test.multiline = true; test.wordWrap = true; test.embedFonts = true; test._alpha = 50; test._rotation = 30; myFormat = new TextFormat(); myFormat.font="web"; //Linkage ID of font myFormat.size = 22; myFormat.color = 0xFF0000; test.setTextFormat(myFormat); hth
Thanks Mr.Jack ... u have been so helpful !! how long have u been working on actionScript ?!
Don't see what you're looking for? Try a search.
|