Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Flash XML / CSS Issue - StyleSheet not applying

  • 14-07-2004 9:46am
    #1
    Registered Users, Registered Users 2 Posts: 2,170 ✭✭✭


    Hey,

    I am developing an XML / CSS Flash application and I am having an extremely frustrating problem where the XML content loads fine, but the stylesheet will not apply to the document.

    I have checked the server logs and the swf requests the stylesheet and gets response code 200 (i.e. success), but the document remains the default text.

    The code I am using to load both they style sheet and XML are as follows:
    // Set TextArea properties
    theNews.border_mc._visible = false;
    theNews.html = true;
    theNews.wordWrap = true;
    theNews.multiline = true;
    theNews.label.condenseWhite=true;
    
    // Load Style Information
    newsStyle = new TextField.StyleSheet();
    newsStyle.load("content/sample.css");
    newsStyle.onLoad = function(loaded) {
    	if (loaded) {
    		theNews.styleSheet = newsStyle;
    	}
    }
    
    // Load Content
    newsContent = new XML();
    newsContent.ignoreWhite = true;
    newsContent.load("content/loadtext.php");
    newsContent.onLoad = function(success)
    {
            if(success)
            {
                    theNews.text = newsContent;
            }
    }
    

    theNews is the name of the TextArea I am loading the XML into. I have looked at the PHP document that generates the XML and it comes out as a perfectly formatted XML document.

    I just cannot understand why it will not work for me, and I am personally tearing my hair out here :p It's the very last thing to do and then the site is finished :(

    Does anybody have any idea what the problem could be? I have searched through dozens of Flash MX 2004 tutorials about external stylesheets etc, but nothing has really helped.

    Many thanks,

    Serb


Comments

  • Registered Users, Registered Users 2 Posts: 2,170 ✭✭✭Serbian


    I take it nobody know so? :)

    Well, I found a way to hard code the style sheets into the FLA file itself. Not desirable as it will make things that little bit more awkward when the syles need to be changed, but I can't seem to get it to work any other way :(

    For anyone who cares, you can hard-code stylesheets like so:
    var docStyleSheet = new TextField.StyleSheet();
    docStyleSheet.setStyle("empty", {fontFamily:'Verdana', fontSize:10, color: '#666666'});
    docStyleSheet.setStyle("date", {fontFamily:'Verdana', fontSize:10, color: '#666666'});
    flash_element.styleSheet = docStyleSheet;
    

    Regards,

    Serb


Advertisement