change the font of text created by createTextField();

Hello!

I do a little flash game for a project at school. Because for some reason, it did not work with the creation of a textfield in design, I created the textfield with this piece of code:

var literWater = 1250;

var gramGraan = 1000;

createTextField ("nogDoen", 1,50,50,300,100);

function nog()

{

nogDoen.text = "I moet nog" + literWater + "en water litre '+ gramGraan +"gram graan verplaatsen.";"

}

Nog();

Now what I don't understand, is how to change the font of this textfield. I wish it were something like Arial, 30pt. How should I do this?

Thanks in advance!

You must use the textformat class to create a new instance of the textformat.  You can then assign properties (font and size) to the textformat instance and finally, set the textformat instance to your textfield.  In addition, you must embed your policy in your library, which is a multi-step process.

your actionscript code should look like:

var tfor:TextFormat = new TextFormat();
Tfor.font = "ArialID";  It must match the id of a police liaison in your library
Tfor.Size = 30;

var tf:TextField = this.createTextField("tf",1,0,0,300,40);

tf.embedFonts = true;
tf.setNewTextFormat (tfor);  or use setTextFormat() If you text assignments before tfor assiging to tf

Tags: Adobe Animate

Similar Questions

  • How can I change the font of text added?

    How can I change the font of text added? I've updated for Adobe Acrobat Reader DC and I can't change fonts on the documents that I write about. Very frustrating because it was easy on the latest version. Can someone please? Moreover, I have a Mac.

    Hi bjneller,

    Change the PDF font is not possible in the reader, for this need you Acrobat application.

    However, you can change the font for the comments on the PDF document in the Edit menu-> preferences-> commenting.

    Kind regards
    Nicos

  • How can I change the font of text in an HTML region

    Hi all

    I have a region HTML on my page and I want to display a banner at the top with a larger font. It is doesn't seem to work.

    For example:
     <b><font size=20 color=red>&P3062_HIDDEN_DATE.</font></b>
    change the color and in fact it "BOLD", but I can't make the text larger. Any ideas?

    Thank you

    Hello

    Try

    &P3062_HIDDEN_DATE.

    Do not use tag make
    >
    The element do is deprecated.

    Deprecated

    An obsolete element or attribute is one that has been exceeded.

    Obsolete elements may become obsolete in the future, but browsers should continue to support the obsolete elements for backward compatibility.
    Obsolete

    Attributes and obsolete items have no guarantee of the browser-support and are more defined in the specification of the W3C.
    >
    http://www.w3schools.com/tags/tag_font.asp

    Kind regards
    Jari

    Published by: jarola November 2, 2010 22:22

  • In Illustrator, I've created a text box and cannot change the font color of black.

    In Illustrator, I've created a text box and cannot change the font color of black. I tried changing each CMYK percentage individually, but it stays black. I have not had this before. What is going on?

    [Left the forum Cloud/Installer generic for program specific forum... MOD]

    akayshay,

    If I (put) understand, you can simply create a region Type, and then select with the normal (black) selection tool, then set the fill color to none in the Toolbox, and then click Add a new fill in the appearance palette and with the selected fill (yet) set your colour (ing) desired.

  • How change the font on the Format RTF model so that all NEW documents are defined on this font when creating.

    I want that all new documents I create using the comic strip without police set to 12pt size, but when I create a new document, RTF, it always comes down to the air police in 10 point size.

    I tried to change the font and size then SAVE AS a document rich TEXT in Wordpad, but every time I create a new document is Arial 10 pt text.

    WordPad is a very basic word processing and does not support contain many advanced features such as types of start-up documents templates and so on.  You would need to buy a real processor for these capabilities.

  • PS CS5: Raise errors when I try to change the font of a text layer

    This is new behavior. If I create a text layer, and then highlight the text and change the fonts to ariel, I get an error indicating that a program error has occurred.

    I did all of the normal photoshop recover things including new preferences and resettlement. No joy. Any ideas?

    What operating system?

    The problems of fonts in Adobe Photoshop CC, 2015, 2014, CS6, CS5

  • PDF fillable where the customer can add text AND change the fonts?

    Hello

    I would like to be able to provide my clients with editable poster templates. I created in InDesign posters, with a large white space in the middle where they can add their own texts, and when they're done, they can send them to the printer. The problem is, I just want to give them - in PDF print quality, so they don't mess up my share of the design (in addition, they are not sufficiently advanced to use indesign or illustrator or something like that).

    I tried implementing a PDF file using a text field, but it won't work. When the customer type in the text field, they will not be able to change the size of font, color, weight, etc.

    Is there some sort of 3rd party plugin that will allow me to create PDF files to fill live where the customer can indeed choose their fonts & things when they fill in their info?

    Thank you!

    Bernd: rich text only allows to apply bold, italic, exposing. It does not allow the user to make the text larger or to change the font.

    When I type ctrl-e in the area I can change the font and the font size.

  • You can change the font size using the form in the preview (not with the text box). Having also arrow drawing trouble in preview.

    You can change the font size using the form in the preview (not with the text box). Having also arrow drawing trouble in preview.

    What problems are you having with the arrow? You go to Tools-> annotate-> arrow and an arrow appears. Then you can drag around the head and tail to make it to the desired location.

  • Can you change the font in emails from texts of pain?

    Y at - it a sequel to change the font in plain text emails?

    I know it can be done in rich text emails.

    I use windows 7 and WLM

    Thank you much for the help.

    If you talk about messages you're writing, then the answer is no. You should be able, but the function does not work in WLMail 2011/2012 - the police will always be 12pt Calibri. It is unimportant, because no police information is transmitted with the message - that's what plain text means. It is entirely software of the recipient that the font is used to display the message when he gets it.

    If you talk about messages you receive, then the font is specified for encoding involved reading from the sheet of program options tab. Press Ctrl-Shift-O to the options. You can see that the font that you specified is not used, but it can come right after the closing of the program, wait a few minutes and he raises.

  • How to select text and be able to change the font without the text highlight color effect reverse?

    I remember being able to select the text with a certain shortcut would not show that it is actually highlighted, but it actually so, essentially the same function as selecting / highlighting just without the Visual indicator that it is highlighted / selected.

    You can change the font by selecting just different fonts in the menu drop-down of the character Panel. It will change the police without selecting text and giving you a reverse color effect.

  • How can I change the font in the text tool?

    How can I change the font in the text tool in Photoshop?

    Hi takmo,.

    Select the text tool and choose the font in the menu in the options bar drop-down font

    Here's the relevant tutorial:

    Add text to images | Adobe Photoshop CC tutorials

    Kind regards

    Claes

  • How do you change the font color in CALL coming OUT of the text boxes in PRO XI?

    How do you change the font color in CALL coming OUT of the text boxes in PRO XI?

    Select it and press Ctrl + E to open the properties bar where the first

    option is the color of the font.

  • Imported text formatting disappears when you change the font in the character palette.

    Something seems to have changed with my InDesign, and I don't know why. Here's what I used to be able to do.

    I could import a word doc into a text box. This text would be bold italic, regular, fonts. I choose the text box, and then change the font using the character palette by changing just the upper box of the police. For example, if the police imported as Helvetica, but I wanted to be all Futura, I check the box and then simply type Futura and all bold Helvetica would become "BOLD" Futura, and italic Helvetica became Futura Italic, etc.. I didn't have to select each row.

    Now if I try to do the same thing, when I select Futura, it changes just ANY text to regular Futura. I lose all the precedents of the formatting that was imported from the word doc.

    I hope this makes sense.

    How can I go back to the way it was?

    Help, please! It's maddening! Not a big deal to design unique flyer but when laying on a book, it could represent DAYS on the project.

    Thank you!

    I fixed it. It was so simple. I just stumbled upon the answer.
    All I had to do was change the search option using this drop-down list. (See the image)

  • Is there a way to allow the end user to change the font color in a text field?

    I didn't know that LiveCycle existed yesterday so I was using the Google a lot.

    I'm building an application form and asked if there was a way to change the font color in a text field. (EXAMPLE: content Original is black.) The notes are in red)

    I have 2 ideas on that, we should type out and highlight, and then click a button to turn red. The other way. I'm more part. Have a radial affecting when turned off, black types. When on, red types. What is the best way to do it or is it still possible?

    Figured it out. Replace 'plain text' 'rich text' and have user support on ctr + e. seems strange to me, but it works.

  • Impossible to change the font in the Indesign text box

    In Indesign (cs4): when I scored the textbox control, and a wish to change the font, I have the last two days as I click on the new police experienced that I desire, but the police does not change. I have to close Indesign, and then I can change the font. ... for a while, and then it happens again, and I must close Adobe again. What is going on?

    (there are a lot of space in the text box, which is not the problem)

    (I got this CS4 for many years, and not until that last week have I had this probem).

    You can rename the files with the name of your choice. I usually have jut add a character _ at the beginning of the name.

Maybe you are looking for