Flash/AS3 Classes

gpUrlLoader - Loading a CSS File

The following example displays the gpUrlLoader Class with an option to load a CSS file. Add the event listener, then call the init method with the url and the load type.

	var ldr:gpUrlLoader = new gpUrlLoader();
	ldr.addEventListener(Event.COMPLETE, sheetLoaded);
	ldr.init('styles.css', 'stylesheet');

	function sheetLoaded(event:Event):void {
		var mycss:StyleSheet = ldr.getStyleSheet();
	}	

For documentation about the gpUrlLoader AS3 Class, view the blog post.