# CSS was load but does not work

**URL:** <https://forum.kirupa.com/t/css-was-load-but-does-not-work/280737>\
**Category:** flash\
**Created:** [January 31, 2009, 1:26am UTC](https://forum.kirupa.com/t/css-was-load-but-does-not-work/280737 "2009-01-31T01:26:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Beebs](https://avatars.discourse-cdn.com/v4/letter/b/47e85d/32.png) [@Beebs](https://forum.kirupa.com/u/Beebs)\
**Post date:** [January 31, 2009, 1:26am UTC](https://forum.kirupa.com/t/css-was-load-but-does-not-work/280737/1 "2009-01-31T01:26:01Z")

</div>

Can anyone look at the code below - why the CSS does not work.

```auto

package {
	import flash.display.*;
	import flash.events.*;
	import caurina.transitions.*;
	//to load external text
	import flash.net.URLLoader;
	import flash.net.URLRequest;
	import flash.net.URLLoaderDataFormat;
	//and for the text field
	import flash.text.StyleSheet;
	import flash.text.TextField;
	import flash.text.TextFormat;
	import flash.text.TextFieldAutoSize;

	public class ScrollBox extends MovieClip {
		
		
		private var reqCSS:URLLoader = new URLLoader();
		private var cssPath:String = "gary.css"
		private var txtLoader:URLLoader = new URLLoader();
		private var textPath:String = "01_01_about_text.html"
		
		public function ScrollBox():void {

			sb.addEventListener(ScrollBarEvent.VALUE_CHANGED, sbChange);	
			
			loadText();
		}
		
		
		
		private function loadText():void {
			txtLoader.addEventListener(Event.COMPLETE, onLoaded);
			content.txtField.autoSize = TextFieldAutoSize.LEFT;
			txtLoader.load(new URLRequest(textPath));
			removeEventListener(Event.COMPLETE, onLoaded);
			reqCSS.load(new URLRequest(cssPath));
			}
			
		private function onLoaded(e:Event):void {
			var sheet:StyleSheet = new StyleSheet();
			sheet.parseCSS(reqCSS.data);
			content.txtField.styleSheet = sheet;
			content.txtField.text = txtLoader.data;
			//content.txtField.htmlext = txtLoader.data;
				}	
			

		private function sbChange(e:ScrollBarEvent):void {
			Tweener.addTween(content, {y:(-e.scrollPercent*(content.height-masker.height)),
			   time:1});
		}
	}
}

```
