change URLRequests by XML, as3
An other XML and Flash question. How do I change my URLRequests by XML? My problem may be something else, but this only happens when I use the XML variable. Thanks.
URLRequest by XML
var bgURL:URLRequest = new URLRequest(url);
/*OUTPUT
Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.
*/
URLRequest by name FILE LOADS, WORKS FINE
var bgURL:URLRequest = new URLRequest("bite.swf");
/*OUTPUT
"bite.swf"
*/
COMPLETE SWF
//LISTEN AND LOAD XML
var myXML:*;
var myLoad:URLLoader = new URLLoader();
myLoad.load(new URLRequest("visibleAdv.xml"));
myLoad.addEventListener(Event.COMPLETE, parseXML);
//PARSE XML
function parseXML(e:Event):void {
myXML = new XML(e.target.data);
//XML VARIABLE
var url:String = (myXML.Lt.text());
trace(url);
//LO开发者_如何转开发AD SWF
var ld:Loader = new Loader();
addChild(ld);
var bgURL:URLRequest = new URLRequest("bite.swf");//"bite.swf"
ld.load(bgURL);
}
XML
<?xml version="1.0" encoding="utf-8"?>
<SESSION>
<Lt TITLE="stage.stageHeight">"bite.swf"</Lt>
</SESSION>
XML Take away the quotations from "bite.swf"
<Lt TITLE="stage.stageHeight">bite.swf</Lt>
SWF This should work fine now
var bgURL:URLRequest = new URLRequest(url);
精彩评论