Hi,
Im trying to load in some HTML text which is formatted by CSS (both are external) and i get this message:
"The following file could not be loaded: Error #2032: Stream Error. URL: file:///C|/Users/Ben/Documents/Productivity/sites/mySite/welcome.html"
I've been searching about this for a few hours but cant make any sense of it. The path to the html file is correct, i've never seen this before. Can anyone explain whats happening or how to get around this??![]()
here is the code i am using...
Thanks for any help (this is killing me!!)Code:public function LoadHTMLCSS() { _cssFile = new URLLoader(); _cssFile.addEventListener(Event.COMPLETE, onLoadCSS, false, 0, true); _cssFile.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler, false, 0, true); _cssFile.load(new URLRequest("welcome.css")); } private function onLoadCSS(evt:Event):void { _css = new StyleSheet(); _css.parseCSS(evt.target.data); _htmlFile = new URLLoader(); _htmlFile.addEventListener(Event.COMPLETE, onLoadHTML, false, 0, true); _htmlFile.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler, false, 0, true); _htmlFile.load(new URLRequest("demo.html")); } private function onLoadHTML(evt:Event):void { _html = evt.target.data; initTextField(); } private function initTextField():void { _txtFld = new TextField(); _txtFld.x = _txtFld.y = 20; _txtFld.width = 500; _txtFld.multiline = true; _txtFld.wordWrap = true; _txtFld.autoSize = TextFieldAutoSize.LEFT; _txtFld.selectable = false; _txtFld.styleSheet = _css; _txtFld.htmlText = _html; _txtFld.addEventListener(TextEvent.LINK, onTextEvent); addChild(_txtFld); _cssFile.removeEventListener(Event.COMPLETE, onLoadCSS); _cssFile.removeEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); _htmlFile.removeEventListener(Event.COMPLETE, onLoadHTML); _htmlFile.removeEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); } private function onTextEvent(evt:TextEvent):void { trace(evt.text); } private function ioErrorHandler(evt:IOErrorEvent):void { trace("The following file could not be loaded: " + evt.text); } } }




Reply With Quote