# \[FMX\] - stylesheet

**URL:** <https://forum.kirupa.com/t/fmx-stylesheet/117266>\
**Category:** Uncategorized\
**Created:** [July 26, 2004, 10:21am UTC](https://forum.kirupa.com/t/fmx-stylesheet/117266 "2004-07-26T10:21:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MZA](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@MZA](https://forum.kirupa.com/u/MZA)\
**Post date:** [July 26, 2004, 10:21am UTC](https://forum.kirupa.com/t/fmx-stylesheet/117266/1 "2004-07-26T10:21:25Z")

</div>

This is weird… I red the stylesheet tutorial in kirupa and in macromedia site but it doesnt work for me. I dont undestand why…

This code should work fine but it doesnt!!!

```auto

var css_styles = new TextField.StyleSheet();
css_styles.load("styles.css");
css_styles.onLoad = function(ok) {
	if(ok) {
		// display style names
		trace(this.getStyleNames());
	} else {
		trace("Error loading CSS file.");
	}
}

```

I have the .css file in same directory and its rights are all allowed. I dont get why its not working… I tried some trace inside the function but it doesnt even do that. whats wrong with this? Does anyone have any idea?

Cheers  
MZA

---

<div class="post-metadata">

**Author:** ![MZA](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@MZA](https://forum.kirupa.com/u/MZA)\
**Post date:** [July 26, 2004, 11:16am UTC](https://forum.kirupa.com/t/fmx-stylesheet/117266/2 "2004-07-26T11:16:01Z")

</div>

Seems that its a version of flash problem. Good to know if anyone else gets the problem someday. 🙂

-MZA

Edit: "To begin with, you must be using Flash MX 2004 or Flash MX 2004 Professional. The following ActionScript will not work unless is it rendered as Flash 7 with ActionScript 2.0. "

voila!
