Solved

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

Posted on 2006-07-09
7
347 Views
Last Modified: 2013-12-03
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
Comment
Question by:irwinpks
  • 5
  • 2
7 Comments
 
LVL 37

Accepted Solution

by:
CyanBlue earned 500 total points
ID: 17069532
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
 
LVL 30

Author Comment

by:irwinpks
ID: 17069792
cool..will work on this later tonight.  thank you!
0
 
LVL 30

Author Comment

by:irwinpks
ID: 17070252
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 30

Author Comment

by:irwinpks
ID: 17070253
Oh yeah...review the above link...I changed the font to Trebuchet MS.
0
 
LVL 37

Expert Comment

by:CyanBlue
ID: 17072058
Check on the TextFormat.align in the Flash manual...  That's what you are looking for...  ;)

CyanBlue
0
 
LVL 30

Author Comment

by:irwinpks
ID: 17075082
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
 
LVL 30

Author Comment

by:irwinpks
ID: 17075091
This is the LAST component to this animation...

:-)

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
EMET 5.2 / Adobe Flash 2 229
Problem witih Adobe Flash Player with a W7 machine 21 51
Google Chrome pepflashplayer.dll 8 125
Cannot install Adove Flash player on Windows 2012R2 6 96
I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now