一段时间以来一直在缩小这个问题的范围,感觉我快要解决它了
我收到错误错误 #1009:无法访问空对象引用的属性或方法。
var request:URLRequest = new URLRequest("http://blahblahblah.com/questions.php");
request.method = URLRequestMethod.GET;
var loader2:URLLoader = new URLLoader();
loader2.addEventListener(Event.COMPLETE, completeHandler);
loader2.dataFormat = URLLoaderDataFormat.VARIABLES;
loader2.load(request);
function completeHandler(event:Event) :void{
var questions:String = event.target.data.questions;
var questionsArray:Array=questions.split("/");
questionbox.question.text = questionsArray[numLoops];
trace("QuestionLoaded");
}
有趣的是当我添加一个“。” 到 URL 的末尾,所以我有“.PHP”。我得到一个不同的错误代码错误 #2101:传递给 URLVariables.decode() 的字符串必须是包含名称/值对的 URL 编码查询字符串
这是我的 PHP 输出
?questions=The+Sea+Swallow+is+an+alternative+name+for+which+bird%3F%2FIn+which+sport+would+you+see+a+Western+Roll%3F%2FWho+is+better+known+as%0B+Herbert+Khaury%3F%2FDiet+is+the+parliament+of+which+country%3F%2FWhat+is+the+real+first+name+of+Coco+Chanel%3F%2FThe+Aztecs+were+natives+of+which+country%3F%2FWhat+was+invented+by+O.A.+North+in+1869%3F%2FKing+Zog+was+the+ruler+of+which+country%3F&answers=Seagull%2FPenguin%2FTern%2FCormorant&correct=0%2F0%2F1%2F0
在此先感谢您的帮助,我真的为此绞尽脑汁。怀疑一个空变量?