# Fading XML content formatted with CSS

**URL:** <https://forum.kirupa.com/t/fading-xml-content-formatted-with-css/63345>\
**Category:** flash\
**Created:** [September 5, 2004, 6:26pm UTC](https://forum.kirupa.com/t/fading-xml-content-formatted-with-css/63345 "2004-09-05T18:26:12Z")\
**Posts on this page:** 4\
**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 5, 2004, 6:26pm UTC](https://forum.kirupa.com/t/fading-xml-content-formatted-with-css/63345/1 "2004-09-05T18:26:12Z")

</div>

I am trying to fade text that is loaded via XML and then formatted by using CSS, the thing is when I try and apply the CSS it stops fading, I have attached a sample fla, I am quite desperate to find a solution to this.

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 6, 2004, 2:59am UTC](https://forum.kirupa.com/t/fading-xml-content-formatted-with-css/63345/2 "2004-09-06T02:59:46Z")

</div>

You need to add “\_parent.” to reference your dynamic txt box as it is not on the \_root level.

var myCSS = new TextField.StyleSheet();  
var cssURL = “stylesheet.css”;  
myCSS.load(cssURL);  
myCSS.onLoad = function(success) {  
if (success) {  
\_parent.myText.styleSheet = myCSS;  
}  
};  
newsContent = new XML();  
newsContent.ignoreWhite = true;  
newsContent.load(“news1.xml”);  
newsContent.onLoad = function(success) {  
if (success) {  
myText.text = newsContent;  
}  
};

---

<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 6, 2004, 9:29am UTC](https://forum.kirupa.com/t/fading-xml-content-formatted-with-css/63345/3 "2004-09-06T09:29:58Z")

</div>

Thanks, but I don’t think that is the problem.

In the end I got a tip from a pal, if the CSS provides a font family it wont work, so I took out the font-family tag and it works fine

---

<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 6, 2004, 1:28pm UTC](https://forum.kirupa.com/t/fading-xml-content-formatted-with-css/63345/4 "2004-09-06T13:28:44Z")

</div>

the .fla you sent didn’t work at all, regardless of the fade up/out. Thus the \_parent. I added. Glad you figured it out.
