# CSS not loading

**URL:** <https://forum.kirupa.com/t/css-not-loading/63405>\
**Category:** flash\
**Created:** [September 6, 2004, 2:26pm UTC](https://forum.kirupa.com/t/css-not-loading/63405 "2004-09-06T14:26:56Z")\
**Posts on this page:** 3\
**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/63405/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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 20, 2004, 7:42pm UTC](https://forum.kirupa.com/t/css-not-loading/63405/2 "2004-09-20T19:42:41Z")

</div>

I am having this same problem. However, I may be wrong about this but I don’t think  
you need to load the same css and xml object twice. You should be able to pull the info needed from a single loaded xml and css object. once again im very new to this so I may be misunderstanding what your doing.

I have one xml and one css file and am trying to load it into two different dynamic text fields. I can get the xml to load to each text field fine, but the css is only working on one of my text fields. My code is very similar to Nick Toye’s above.

Anyone have any ideas?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 28, 2004, 4:46pm UTC](https://forum.kirupa.com/t/css-not-loading/63405/3 "2004-09-28T16:46:59Z")

</div>

Any ideas on this, I have just returned from a three week holiday, so I am looking for a quick solution on this.
