A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: StyleSheet Issues

  1. #1
    Senior Member
    Join Date
    Sep 2007
    Location
    UK
    Posts
    194

    StyleSheet Issues

    Actionscript Code:
    subMenu = new XML();
    subMenu.ignoreWhite = true;
    subMenu.onLoad = function(success) {
        if (success) {
            newsText = String(this.firstChild.childNodes[0].childNodes[0].childNodes[0]);
        }
    };
    subMenu.load("BusinessUnitData.xml");
    var styleObj:TextField.StyleSheet = new TextField.StyleSheet();
    styleObj.onLoad = function(success:Boolean) {
        if (success) {
            news_txt.styleSheet = styleObj;
            news_txt.htmlText = newsText;
        }
    };
    styleObj.load("flash.css");

    Anyone explain this to me?

    I have it working if the code in the news_txt variable is a String written directly into the AS, but I want to bring it in from a CDATA tag within the XML page. I have tried everything but still coming up blanks. Text shows but never any formatting.

    Anyone come across something like this before?
    Last edited by michaeltowse; 10-22-2010 at 11:19 AM.

  2. #2
    Senior Member
    Join Date
    Sep 2007
    Location
    UK
    Posts
    194
    Solved!

    Actionscript Code:
    var styleObj:TextField.StyleSheet = new TextField.StyleSheet();
    styleObj.onLoad = function(success:Boolean) {
        if (success) {
            newsText.styleSheet = styleObj;
        }
    };
    styleObj.load("flash.css");
    subMenu = new XML();
    subMenu.ignoreWhite = true;
    subMenu.onLoad = function(success) {
        if (success) {
            newsText.htmlText = this.firstChild.childNodes[0].childNodes[0].childNodes[0].firstChild.nodeValue;
        }
    };
    subMenu.load("BusinessUnitData.xml");

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