Change Font Size TextFormat in TextField

Project: Simple Click Counter of two separate buttons.
Problem: Font size of clicks needs to be changed/increased.
link to .fla
Not sure where to place this code in the script below.
(inserting it causes font to initially to be correct size of 20 but changes back to default when a mouse click is issued)
var myFormat:TextFormat = new TextFormat();
myFormat.size = 20;
fl_TF.setTextFormat(myFormat);
var myFormat:TextFormat = new TextFormat();
myFormat.size = 20;
fl_TF2.setTextFormat(myFormat);
Script without myFormat:TextFormat applied.
var myVar=0;
var myVar2=0;
button_1.addEventListener(MouseEvent.CLICK, fl_ClickToPosition);
button_2.addEventListener(MouseEvent.CLICK, fl_ClickToPosition2);
var fl_TF:TextField
var fl_TF2:TextField
fl_TF = new TextField();
fl_TF2 = new TextField();
fl_TF.autoSize = TextFieldAutoSize.CENTER;
fl_TF2.autoSize = TextFieldAutoSize.CENTER;
fl_TF.textColor = 0xffffff;
fl_TF2.textColor = 0xffffff;
fl_TF.background = false;
fl_TF2.background = false;
fl_TF.border = false;
fl_TF2.border = false;
fl_TF.x = 102;
fl_TF2.x = 102;
fl_TF.y = 85;
fl_TF2.y = 255;
fl_TF.text = String(myVar);
fl_TF2.text = String(myVar2);
addChild(fl_TF);
addChild(fl_TF2);
function fl_ClickToPosition(event:MouseEvent):void
     myVar++;
     fl_TF.text = String(myVar);
function fl_ClickToPosition2(event:MouseEvent):void
     myVar2++;
     fl_TF2.text = String(myVar2);
Any help is greatly appreciated
Thank you

The setTextFormat method applies the formatting to the text in the textfield, not the textfield itself.  So when you rewrite the text in it, you basically revert back to the default formatting.  You would need to use the setTextFormat each time you write text to the textfield(s).  If the intention is to always have the text be size 20, then you can modify the default formatting instead, right after you instantiate the two textfields....
var fl_TF:TextField = new TextField();
var fl_TF2:TextField = new TextField();
var myFormat:TextFormat = new TextFormat();
myFormat.size = 20;
fl_TF.defaultTextFormat = myFormat;
fl_TF2.defaultTextFormat = myFormat;
(note: you didn't need to define two formats by the same name)

Similar Messages

  • Changing font/-size of a text field on master-pages not possible? (field prop)

    Hi,
    I would like to change the font and font-size of a textfield on a master page.
    I wonder if I do anything wrong, because the font-options (size, font etc.) are simple greyed out / not avaliable, when I click on my text field.
    It seems, there is any way to customize the font-properties of a textfield (only) on master-page.
    Well I guess it would work with java script in init-event ...  but really, why the hell it should not be possible simply to use the properties/text properties?!
    Please correct me if I am wrong. Do I do anything wrong or is it really not possible to customize font of a text field on master pages?

    Hi,
    I was just about to post, that I figured it out.
    Actually, I use Livecycle Designer in SAP (transaction SFP). There seems to be a bug (one of hundrets by the way).
    If I click on a field, that does not have text-property e.g. subform, text-option menu greys out.
    Afterwards it stay this way until I click/doubleclick into a simple text (not text field). From that moment on, text/font-option menu is available again, until I click on something without text. => So pay attention and click wisely
    coming soon: "SAP meets Livecycle Designer - a (Bug)Lovestory", hardcover 124 Pages. ; )
    by the way: SAP does not sopport interactive forms higher than Reader 8.1. Its statement "8.1 is fine enough for everything you need in a SAP/Adobe Interactive Form". So beware of using XFA higher than in 8.1. sad, but true ...

  • How to change font size in textarea?

    how to change font size in textarea?

    to embed a font using actionscript requires adding the font to your library.  to do that, click the upper right of your library panel, click "new font..", select the font you want and click ok.  find the added font in your library, right click, click properties and tick "export for actionscript" (click the actionscript tab if you don't see that option, at first).  assign a class name (eg, WhateverFont).  you can then use:
    var tfor:TextFormat = new TextFormat();
    tfor.size=22;
    var yourfont:Font=new WhateverFont();
    tfor.font = yourfont.fontName;
    ta.setStyle("embedFonts",true);
    ta.setStyle("textFormat",tfor);

  • Font size in a TextField

    Hello !
    I'm using a javax.microedition.lcdui.TextField to enter a few digits.
    These digits were shown very small...
    Is there any way to change the font-size in the text field?
    Greetings
    Micha

    The font size is set by the implementation of the text field. So it may be one size on one device and another size on a different device. Each device's implementation should normally have the appropriate text size for the size of its display and it should match the size of all of the other text on the device.
    So to answer your question, it is not possible to change the font size within a TextField. If you want more control over things like that, then you need to create your own components by extending CustomItem or Canvas.
    You will find that once you try your application on another device it will look better anyway.

  • How to change font size on screen

    how to change font size on screen

    I'm not certain what font sizes you wish to change, when on a page you can use command and the += button to zoom in and make the fonts larger. On the finder desktop you can make what ever is on the desktop larger or smaller from the finder menu click view, custom view options, and adjust the icon size with the slider on the top, and the text using the text size box to select the size that your comfortable with.
    Forgot to add these.
    http://support.apple.com/kb/PH10876
    http://support.apple.com/kb/PH10877
    Hope this helps.

  • How can I change font size in iCal 3.0.8?

    How can I change font size in iCal 3.0.8?

    Julian,
    There is no user option to change the font size in iCal.
    For other posts regarding this topic, read some of the links in "More Like This." box just to the right of your first post in this thread.

  • How to change font size on web page when have no icon in View tool to do so

    menu bar at top of screen does not have icon to change font size of a web page as described in your support information--you show it as between stop and reload in View icon and I do not have it at all in my toolbar.

    See this: <br />
    https://support.mozilla.com/en-US/kb/Page+Zoom

  • How to change Font Size of Object Explorer in "SQL Server Management Studio"

    Dear Team,
    "SQL Server Management Studio" is a fantastic IDE for the database.
    There are so many customization options available but one thing many users missing is that " How to change Font Size of Object Explorer?"
    Can you please accumulate this feature in IDE ASAP?
    Many Thanks,
    Bhavesh

    Its there
    Go to Tools -> Options
    Then under Environment you've fonts and colors tab where you can specify a higher font size.
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to change font size, maximum column size in the result screen ?

    hi All
    That's great when using SQL Dev.
    But I also have a trouble that how to change font size, maximum column size in the result screen ?
    My users think that font in result screen is shown very small, and whenever the data in each colum is long then it's not shown full data in column, they must double click for extend the size. Have the option to default the max size for showing full data in each column ? I try but still not to do that .
    Appreciate for anyone to help us.
    Thanks all.
    Sigmasvn

    You can't change the font for the results screen yet, however you will be able to select an auto-fit option for selected columns, so if some columns have slitghtly wider text you'll be able to set the column widths to handle these wider columns.
    Also, there s the option of switching the layout of a record in the grid.
    Sue

  • How to change font size and style in keynote for ios

    How to change font size and style in keynote for ios

    Same situation for report parameter input value font. What ever we do , it is still Arial and size 10.

  • How to change font size in dreamweaver

    hello?  this is really a bit of overkill for a simple question.  could someone please help with this?
    and while we're at it there's a fly i want to kill with a sledge hammer

    If by changing font-size you mean in your web pages, the answer is use CSS with values in px, em or %.
    body {font-size: 100%}
    p {font-size: 1em}
    h1 {font-size: 3em}
    h2 {font-size: 2.5em}
    h3 {font-size: 2em}
    h4 {font-size: 1.5em}
    and so on....

  • How to change font size in Notification center?

    Good day
    I purchased new monitor with BIG resolution an dfount what font in notification message from Notification Center stay very small
    I try to find place where possible change font siza but don't found anything
    Please help

    AFAIK there is no way to customize this font size. You can't resize the window either.
    You need to report it to Apple Feedback so it can be logged and put in the queue to be fixed.
    http://www.apple.com/feedback/macosx.html

  • How to change font size in a call-out tool box?

    Hi, the other day i inserted a call-out tool box in a PDF document, however i cannot find anything that can change the font size of the letters i input in that box. could anyone help? Thanks.
    Sherman

    This is a question for the Acrobat support forums – please post there.
    From: Adobe Forums <[email protected]<mailto:[email protected]>>
    Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
    Date: Wed, 23 Nov 2011 10:55:07 -0800
    To: Leonard Rosenthol <[email protected]<mailto:[email protected]>>
    Subject: how to change font size in a call-out tool box?
    Re: how to change font size in a call-out tool box?
    created by danmarch<http://forums.adobe.com/people/danmarch> in PDF Language and Specifications - View the full discussion<http://forums.adobe.com/message/4043425#4043425

  • How to change font size in smartform and set layout of smartform

    Dear abapers,
                           I want to change font size in smartform and also set the layout of smart form how can we do this.
                                                 Thank you sir.

    Hi,
    you can do it first you need to goto smartforms tcode there click on radiobutton 'Style'.
    Give any name and click on create. Right sideyou can find character format right click on it and create a node .A pop will raise gve a 2 characterlike z1 or a1 etc click on font tab gve size and font style and click on save and activate. Use this style in your smartform you can apply what ever styles created in styles you can use it in your smartform by that smartstyle name.
    When we create text in output options give your smart style name and click on general attributes . Select your text and apply the style what thse size it should be and what the font style it should be.
    Goto smartforms tcode and select formpainter in application bar set layout according to your requirement.
    Thanks,
    venkat

  • How to change font size in check printing program in AP Invoice

    I would like to know how to change font size in check printing program in Oracle Payables Module for Invoice printing. We are using Oracle standard
    report to print check.
    Concurrent program short name : APXPBFEL
    Prt file : APLASP.prt
    I modified prt file for code 199 like below
    code "199" esc "(8U" esc "(s0p12.00h10.00v0s0b3T" esc "&k11.75H"
    Font size changed for last page only which prints checks, for Void pages its printed with default font. For Page 1 printed with default font and page 2 has reduced font. This change is not intiallized for all pages.
    Please let me know if you any of you know how to change fonts.
    Thanks,
    Anand

    *Default FullZoom Level: https://addons.mozilla.org/firefox/addon/default-fullzoom-level/

Maybe you are looking for

  • How to find out if a script is ran, or dot-sourced?

    This came up in a little thing I was working on... I'd like to be able to detect if a script is being ran "cold", or if it's being dot-sourced. I've had a good search but no luck so far. eg, if a script can detect whether it's being ran as .\myscript

  • How to include Navigational attribute in the selection screen

    Hello All, Can any body please tell me how to include a navigational attribute in the selection screen in BEX?

  • Php if/elseif and mysql

    I was wondering if you could help we with this. PART 1 i have a table of students info. I give the students praise points for doing well in the lesson. I want to compare two students's praise points, if one is bigger (Higher) than the other i want to

  • Duplicate song names appearing in error

    My library keeps renaming tracks with the wrong song name. Two tracks will appear to have the same name but if you look at the track length it's actually two different tracks sharing the same name.  When you click on it one track the other is removed

  • How to make it move correctly?

    I made a simple Flex application. There is a helicopter which will move to points that user clicks in the canvas. For example, it is at A point. When I click at B point, the helicopter will move to B. Then it will move to C when I click at C. However