all groups > flash actionscript > june 2004 >
You're in the

flash actionscript

group:

Advanced programming problems


Advanced programming problems TheBimmer
6/27/2004 12:23:07 PM
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 .

Re: Advanced programming problems Jack.
6/27/2004 12:34:11 PM
#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
Re: Advanced programming problems Rooster60602
6/27/2004 12:38:15 PM
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.
Re: Advanced programming problems TheBimmer
6/27/2004 12:56:18 PM
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";
Re: Advanced programming problems Jack.
6/27/2004 1:05:29 PM
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
Re: Advanced programming problems TheBimmer
6/27/2004 3:41:26 PM
Thanks Mr.Jack ...

u have been so helpful !!

how long have u been working on actionScript ?!
AddThis Social Bookmark Button