• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 364
  • Last Modified:

Changing Font Style in the following code to "Verdana", including size & color attributes

Hello Fellow Experts,

This is in reference to the following question...
http://www.experts-exchange.com/Web/WebDevSoftware/Flash/Q_21901653.html

My text comes out Times Roman and the color is blue.  I would like to modify the font, color, and size.  View the accepted comment for the working code.
Here is the link to my Flash animation;
http://www.ctrlaltdel-usa.net/sha1977/graduates/150/students_2.html

What do I need to change?


Thank you,

Irwinpks
0
Irwin Santos
Asked:
Irwin Santos
  • 5
  • 2
1 Solution
 
CyanBlueCommented:
Well...  That's where you have to specify it within the TextFormat object...  

First of all, add the font line like this...

var _tf = new TextFormat();
_tf.font = "Verdana";
_tf.color = 0x0000FF;
_tf.size = 14;

If you need to change the color, it's the line that says color, and the same goes to the size as you can easily guess...  ;)

No, we're not done yet...
Open up the Library panel...
Click on the menu on the right top corner of the panel and select New Font and set it like this...
   Name : Verdana
   Font : Verdana
You should see the Verdana in the library as a newly created item...
Right click on that and select Linkage...
Select the first item, Export for ActionScript, and hit OK button...

Test movie and your font is embedded properly...

Let me know...  :)

CyanBlue
0
 
Irwin SantosComputer Integration SpecialistAuthor Commented:
cool..will work on this later tonight.  thank you!
0
 
Irwin SantosComputer Integration SpecialistAuthor Commented:
Looking good so far...

This line...
_mc.createTextField("name_txt", theDepth++, 0, imgH + gap, imgW, 20);

where the position of the text (firstname & lastname) is set..how can we make it centered?  I was thinking taking the length of the first name + lastname, and divide by 2..take the integer of that and add it to the above line.

how can we do this?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
Irwin SantosComputer Integration SpecialistAuthor Commented:
Oh yeah...review the above link...I changed the font to Trebuchet MS.
0
 
CyanBlueCommented:
Check on the TextFormat.align in the Flash manual...  That's what you are looking for...  ;)

CyanBlue
0
 
Irwin SantosComputer Integration SpecialistAuthor Commented:
Ok..I don't have my Flash book in front of me.  However, I checked this out;

http://wiki.media-box.net/documentation/flash/textformat/align

...and stuck the following line in
------------------------
 _tf.align = "center";
------------------------

 var _tf = new TextFormat();
_tf.font = "Trebuchet MS";
_tf.color = 0xffcc00;
_tf.size = 12;
_tf.align = "center";

AND IT WORKS!!

Thanks!

0
 
Irwin SantosComputer Integration SpecialistAuthor Commented:
This is the LAST component to this animation...

:-)

http://www.experts-exchange.com/Web/WebDevSoftware/Flash/Q_21914066.html
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now