We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now


HTML fomatting wrong in flash 8 dynamic text area

spanout asked
Medium Priority
Last Modified: 2010-04-03
I am quite new to flash and am experimenting with version 8.  I have some actionscript which runs, but the result is not as expected.

The objective is to load a dynamic text area with HTML from code. It steps through a bunch of array items, putting the contents (in html) into the box. The first 2 display perfectly, then the 3rd is all screwed up with different fonts and list tags where there shouldn't be. It seems that if it displays a list in one message, then the next one will not format correctly. Also get the problem with bold as well. My code is below. I wondered if I have to clear something in the control before loading next html content in? Any help would be greatly appreciated. narrbox is the text area (there is another as well -titlebox which is ok):


var arrMsg=new Array()

arrMsg[1] = "<p><b>YYYY</b> is vital to xxxx because our organisation is <b>reliant</b> on Technology to support the business.</p>"
arrMsg[2] = "<p>YYYY will enable us to:<li>Make informed business risk management decisions</li><li>Support our Clients</li><li>Maintain Regulatory compliance</li><li>Achieve our business goals.</p>"
arrMsg[3] = "<p>We have:</p><li>Helped protect the Business</li><li>Avoided expenditures on non-material issues</li><li>Achieved successful cooperation with Business Owners</li><p>Cooperation with the YYYY Team ensured that:</p><li>The majority of high rated risks have been mitigated in a cost effective manner prior to entering the production environment.</li></p>"
arrMsg[4] = ""

this.createClassObject(mx.controls.UIScrollBar, "my_sb", 20);
function setUpSB() {
      my_sb.setSize(16, narrbox._height);
      my_sb.move(narrbox._x+narrbox._width, narrbox._y-5);
      my_sb.symbolDisabledColor = 0x000000;
      var flash_css = new TextField.StyleSheet();

      flash_css.onLoad = function(success:Boolean) {
            if (success) {
                  narrbox.styleSheet = flash_css;
                  titlebox.styleSheet = flash_css;
            } else {
                  trace("Could not load CSS file.");

var slide=0;
function setNarrator(sMsg, sTitle) {
      if (sMsg!=""){slide = slide + 12};
      progbar._width = slide;

      narrbox.text = arrMsg[sMsg];
      titlebox.text = '<p class="headline">'+sTitle+'</p>';
Watch Question

Wow, amazing how long that took to find! :)

You're just missing an </li> at the end of arrMsg[2]

<li>Achieve our business goals.</p>

should be

<li>Achieve our business goals.</li></p>


Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts


Thanks Sam, I will try that, but when I load the next message, is the old stuff not cleared out?


Yes, it clears the box and replaces old with new.

But, I've never been able to explain the fact that errors carry over, like in your case.  The missing </li> is a formatting error, but I have no idea why that error carries over to the next one even though the old text is cleared out.



Thanks Sam that worked... looks like it doesn't clear out the previous values properly, and the html support is really poor as well.

Yes, html support is really poor in Flash.  I don't use Flash 8 yet, but I'm surprised they haven't done more about that yet.  Of course, html isn't really the scope of the application, so any html support at all is just an added bonus! :)

Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.