A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Multi-coloured text in dynamic text field

  1. #1
    Grandmaster Flash
    Join Date
    Apr 2004
    Location
    Edinburgh, Scotland
    Posts
    139

    Multi-coloured text in dynamic text field

    Hi

    I need to create a text field with Actionscript that is comprised of text in 2 colours. Is this possible (maybe with textformat)?

    Thanks in advance

    g
    If it ain't broke, don't fix it.

  2. #2
    Grandmaster Flash
    Join Date
    Apr 2004
    Location
    Edinburgh, Scotland
    Posts
    139
    I'd really like to know if this is possible or not.

    Thanks
    If it ain't broke, don't fix it.

  3. #3
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    is this what you seek ?
    Code:
    this.createTextField("mytext", 10, 300, 200, 10, 10);
    mytext.autoSize = true;
    mytext.html = true;
    mytext.htmlText = "Hello Mum :)<br>"+
    "<p align='center'>Hello<br>World";
    mytext.textColor = 0x00FF00;
    
    format = new TextFormat();
    format.color = 0xFF0000;
    format.size = 25;
    mytext.setTextFormat(6,18,format);

  4. #4
    Grandmaster Flash
    Join Date
    Apr 2004
    Location
    Edinburgh, Scotland
    Posts
    139
    Thanks modified dog - this looks promising. I take it I can use this with an embedded font too?

    Cheers
    If it ain't broke, don't fix it.

  5. #5
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    Sure can.
    Link your font in the Library and use its identifier name

    mytext.embedFonts = true;

    format.font = "web"; // Linkage name of font

  6. #6
    Grandmaster Flash
    Join Date
    Apr 2004
    Location
    Edinburgh, Scotland
    Posts
    139
    that's great.

    Thanks again
    If it ain't broke, don't fix it.

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