HTML fomatting wrong in flash 8 dynamic text area

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>';
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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>


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
spanoutAuthor Commented:
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.

spanoutAuthor Commented:
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! :)

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.