# AS3.0 with XML support display problem

**URL:** <https://forum.kirupa.com/t/as3-0-with-xml-support-display-problem/315159>\
**Category:** flash\
**Created:** [October 19, 2010, 8:35am UTC](https://forum.kirupa.com/t/as3-0-with-xml-support-display-problem/315159 "2010-10-19T08:35:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frooble](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@Frooble](https://forum.kirupa.com/u/Frooble)\
**Post date:** [October 19, 2010, 8:35am UTC](https://forum.kirupa.com/t/as3-0-with-xml-support-display-problem/315159/1 "2010-10-19T08:35:42Z")

</div>

I have a small problem with loading in a XML-file into an AS3.0 script  
The thing is the code is not giving errors but my screen is not displaying my content. What should I do 🔗?

_ **XML-File:** _  
\<?xml version=“1.0” encoding=“UTF-8” ?\>  
\<quiz\>  
\<title\>The Quiz\</title\>  
\<Items\>  
\<Item\>  
\<question\>Which one of the following processes can occur in a living cell?\</question\>  
\<option1\>Endocytosis\</option1\>  
\<option2\>Osmosis\</option2\>  
\<option3\>Diffusion\</option3\>  
\<option4\>Bulk filtration\</option4\>  
\</Item\>  
\<Item\>  
\<question\>What position did Stalin hold in 1917\</question\>  
\<option1\>Deputy to Lenin\</option1\>  
\<option2\>Editor of Pravda\</option2\>  
\<option3\>Party Leader\</option3\>  
\<option4\>Head of Propaganda\</option4\>  
\</Item\>  
\<Item\>  
\<question\>Which of the following was the predecessor of the Milky Way bar\</question\>  
\<option1\>Lardy Larry\</option1\>  
\<option2\>Penny Plump\</option2\>  
\<option3\>Belly Bart\</option3\>  
\<option4\>Fat Emma\</option4\>  
\</Item\>  
\<Item\>  
\<question\>What does “html” stands for\</question\>  
\<option1\>Hypertext Markup Language\</option1\>  
\<option2\>Hyper Tool Marker Language\</option2\>  
\<option3\>Homepage Text Mini Language\</option3\>  
\<option4\>Hypertranslation Micro Language\</option4\>  
\</Item\>  
\<Item\>  
\<question\>Who was the author of the book “The Time Machine”\</question\>  
\<option1\>H.G. Wells\</option1\>  
\<option2\>Lewis Carroll\</option2\>  
\<option3\>Charles Lamb\</option3\>  
\<option4\>Robert Louis Stevenson\</option4\>  
\</Item\>  
\<Item\>  
\<question\>The national sport in Canada is?\</question\>  
\<option1\>Rugby\</option1\>  
\<option2\>Cricket\</option2\>  
\<option3\>Judo\</option3\>  
\<option4\>Lacrosse\</option4\>  
\</Item\>  
\<Item\>  
\<question\>What is the global netnumber of the Netherlands\</question\>  
\<option1\>0072\</option1\>  
\<option2\>0023\</option2\>  
\<option3\>0031\</option3\>  
\<option4\>0042\</option4\>  
\</Item\>  
\</Items\>  
\</quiz\>

_ **AS3.0:** _  
import flash.net.URLLoader;  
import flash.events.Event;  
var questions:Array = new Array();  
var answers:Array = new Array();  
var XMLloader:URLLoader = new URLLoader();  
XMLloader.addEventListener(Event.COMPLETE,loadXML);  
XMLloader.load(new URLRequest(“quiz.xml”));  
function loadXML(e:Event):void  
{  
var myXML = new XML(e.target.data);  
var loop = myXML.Item.length();  
for (var i=0; i\<loop; i++)  
{  
questions\*= myXML.Item\*.question.text;  
answers\*=[myXML.Item\*.option1,  
myXML.Item\*.option2,  
myXML.Item\*.option3,  
myXML.Item\*.option4];  
}  
gotoAndPlay(2);  
}  
var qno=0;  
function change\_question(){  
question.text=questions[qno];  
option1.text=answers[qno][0];  
option2.text=answers[qno][1];  
option3.text=answers[qno][2];  
option4.text=answers[qno][3];  
}  
stop();
