# CSS not loading

**URL:** <https://forum.kirupa.com/t/css-not-loading/121746>\
**Category:** Uncategorized\
**Created:** [September 6, 2004, 2:26pm UTC](https://forum.kirupa.com/t/css-not-loading/121746 "2004-09-06T14:26:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nick\_Toye](https://avatars.discourse-cdn.com/v4/letter/n/82dd89/32.png) [@Nick\_Toye](https://forum.kirupa.com/u/Nick_Toye)\
**Post date:** [September 6, 2004, 2:26pm UTC](https://forum.kirupa.com/t/css-not-loading/121746/1 "2004-09-06T14:26:56Z")

</div>

I have two MC’s news1 & news2.

Each of them has an identical xml constructor and css constructor. The first one loads ok, but the second one does not.

Here is my code for news1

```auto

//load css
var myCSS = new TextField.StyleSheet();
var cssURL = "stylesheet.css";
myCSS.load(cssURL);
myCSS.onLoad = function(success) {
	if (success) {
		myTitle.styleSheet = myCSS;
		myContent.styleSheet = myCSS;
	}
};
//add xml content
newsContent = new XML();
newsContent.ignoreWhite = true;
newsContent.load("news.xml");
newsContent.onLoad = function(success)
{
	if(success)
	{
		myTitle.text = newsContent.firstChild.firstChild.firstChild;
		myContent.text = newsContent.firstChild.firstChild.firstChild.nextSibling;
	}
}

```

news2

```auto

//load css
var myCSS = new TextField.StyleSheet();
var cssURL = "stylesheet.css";
myCSS.load(cssURL);
myCSS.onLoad = function(success) {
	if (success) {
		myTitle.styleSheet = myCSS;
		myContent.styleSheet = myCSS;
	}
};
//add xml content
newsContent = new XML();
newsContent.ignoreWhite = true;
newsContent.load("news.xml");
newsContent.onLoad = function(success)
{
	if(success)
	{
		myTitle.text = newsContent.firstChild.firstChild.nextSibling.firstChild.firstChild;
		myContent.text = newsContent.firstChild.firstChild.nextSibling.firstChild.nextSibling.firstChild;
	}
}

```

My XML file

```auto

<newsContent>
	<newsA>
		<newsAtitle>New Web Site Launched</newsAtitle>
		<newsAstory>A new website has been launched to showcase Nick Toye's work. It is modelled on various influences from the New Beetle, to Royksopp music. A smooth transition was one of the main aims, along with an ease of use.
I wanted to provide information without it getting lost in the navigation, I feel that I have achieved this simplicity.
I have found that in many of my designs, white space generates a calming atmosphere and allows the content to flow with more impact.</newsAstory>
	</newsA>
	<newsB>
		<newsBtitle>Some more news</newsBtitle>
		<newsBstory>Some more news will go here</newsBstory>
	</newsB>
</newsContent>

```

and my CSS stylesheet

```auto

newsAtitle {
color: #990000;
font-size:10px;
}
newsAstory {
color:#006699;
font-size:10px;
}
newsBtitle {
color: #990000;
font-size:10px;
}
newsBstory {
color:#006699;
font-size:10px;
}

```

If anyone can see why the stylesheet isn’t loading for the second MC I will be most grateful.

Many thanks in advance
