A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Do Bold and Italics Tags Work in HTML Text Fields?

Hybrid View

  1. #1
    I tried to locate one answer for this on the boards and couldn't yet. I've been finding contadictory answers.

    I've got a dynamic text field that I want to put some HTML text into. I've checked the HTML box for the text properties and it seems to work with underline tags <u></u> and anchors <a href=""></a>, but as soon as I use bolding or italics, the text doens't show up. I'm just assigning text to the variable name for the text field like this:

    Code:
    viewer.sourcetext = "<b>" + article_name+ "</b>, " + article_date;
    and the result I'm getting looks like this:

    Code:
    , Tues Apr 15, 2001
    and the headline text that should be at the start of that string in bold just doesn't show at all.

    Is there a way to mix bold text into your HTML text fields if the tags are apparently broken?
    [Edited by mikebrittain on 05-03-2001 at 04:36 AM]

  2. #2
    9th Grade WC
    Join Date
    Sep 2000
    Posts
    1,192
    have you tried using ' instead of "
    for your html tags

  3. #3
    Do you mean like this?

    Code:
     viewer.sourcetext = '<b>' + article_title + '</b>, ' + article_date;
    Thanks for the suggestion, but I just tested this and it gave no difference in the resulting text. I don't know why there should be a difference between the type of quotes for this type of situation since there is nothing (no characters) that needs to be escaped. If I am overlooking something in the usage of double- and single-quotes, please let me know.

  4. #4

    FIX

    I figured out a fix for this problem and I've submitted a movie to FlashKit to demonstrate the workaround.

    I found out that you cannot use bold styles <b> for your HTML text field unless Flash has included the proper outlines for bold text (specific to the font that you want to use). Likewise, you can only use italics <i> or a combination of bold and italics <b><i></i></b> if you have included text in your movie that uses each of these styles as well.

    Plain, bold, italic, and bold-italic font outlines are each handled separately. Each must be used in the movie (at time of export) if you want to be able to include HTML text that uses these respective styles.

    It would certainly help for Macromedia to make this more obvious in the documentation or provide a method to make it easier to handle this in Flash 6.

    If someone knows a better solution, please let me know.

    If you would like a copy of the demonstration that I have written, please use this link. I will send an updated link to the board when it is posted by FK.

    http://www.embimedia.com/mike/misc/dyn_html_text.html

    http://www.embimedia.com/mike/misc/dyn_html_text.zip [70 KB]

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