A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: How2 Display large numbers

  1. #1
    Member
    Join Date
    Oct 2006
    Location
    Seattle, WA
    Posts
    45

    How2 Display large numbers

    I am interested in showing large incrementing numbers. I actually need to show a number that decrements each second, but I am not interested in the details at this time. Here is what I have found that works a little...

    -------------
    script "When Movie starts"
    var count = int;
    createTextField("field",getNextHighestDepth(), 100,100,0,0);
    field.autosize = "left";

    script "On every frame"
    count++;
    field.text = count;
    --------------
    How do I make the numbers larger?
    Thanks, JZ
    Jan Zumwalt - http://www.flash.neatinfo.com

  2. #2
    Member
    Join Date
    Oct 2006
    Location
    Seattle, WA
    Posts
    45
    One of the things I tried from an example I found was...

    var count = int;
    var big_numbers:TextFormat = new TextFormat();

    big_numbers.size = 12;
    big_numbers.bold = true;
    big_numbers.font = "Arial";
    big_numbers.color = 0xFF0000;

    this.createTextField("field",getNextHighestDepth() ,100,100,0,0);
    field.setNewTextFormat(big_numbers);

    But I get an ERROR...
    setNewTextFormat() is not a method of 'TextField' in 'show_count' on line 10 field.setNewTextFormat (big_numbers)
    Jan Zumwalt - http://www.flash.neatinfo.com

  3. #3
    Member
    Join Date
    Oct 2006
    Location
    Seattle, WA
    Posts
    45
    OK! I got it working.
    -------------------------
    script "When Movie starts"
    -------------------------
    // flash9 ver
    var count = int;

    var fld_score:TextField = new TextField();
    fld_score.x = 10;
    fld_score.y = 10;
    fld_score.width = 100;
    fld_score.height = 50;
    fld_score.border = true;
    addChild(fld_score);
    // for flash 8, remove previous line and uncomment lines
    // createTextField("fld_score",getNextHighestDepth(), fld_score.x,
    // fld_score.y,fld_score.width,fld_score.height);

    var txt_format:TextFormat = new TextFormat();
    txt_format.font = "Arial";
    txt_format.size = 30;
    txt_format.bold = true;
    txt_format.color = 0xFF0000;
    fld_score.setTextFormat(txt_format);
    -------------------------
    script "On every frame"
    -------------------------

    count++;

    txtfield.text = int(count/20);
    Last edited by jwzumwalt; 04-29-2008 at 01:46 AM.
    Jan Zumwalt - http://www.flash.neatinfo.com

  4. #4
    Member
    Join Date
    Oct 2006
    Location
    Seattle, WA
    Posts
    45
    The above should read.... Sorry!

    count++;

    fld_score.text = int(count/20);
    Jan Zumwalt - http://www.flash.neatinfo.com

  5. #5
    Senior Member Zoranan's Avatar
    Join Date
    May 2008
    Posts
    126
    looks complicated

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center