import com.quiz.*;
import com.utilities.*;
class com.quiz.Quiz_intro extends Quiz_base
{
private var xmlStr:XML;
private var ok:Boolean;
public function Quiz_intro()
{
setup()
}
private function setup()
{
//loading the xml and and when done call parseMyXml
var myXml:String = "quiz_content.xml"
xmlStr = new XML;
xmlStr.ignoreWhite = true;
xmlStr.onLoad = Proxy.create(this,onLoadXML,ok)
xmlStr.load(myXml)
}
private function onLoadXML(ok:Boolean):Void
{
if(!ok)
{
trace("not loaded")
}
else
{
xmlStr = xmlStr.childNodes[0]
parseMyXML();
}
}
private function parseMyXML()
{
trace("no")
//we are dividing the content of the xml and putting in static variables
Quiz.title = xmlStr.childNodes[0].attributes.name
Quiz.quiz_content = xmlStr.childNodes[0].childNodes;
Quiz.solutions = xmlStr.childNodes[1].childNodes;
delete xmlStr;
trace("title: " + Quiz.title)
trace("*************************")
trace("content " + Quiz.quiz_content)
trace("*************************")
trace("solution " + Quiz.solutions)
}
}
static var title:String
static var quiz_content:Array
static var solutions:Array
So if you publish your movie you will see in the trace all the three arrays in the output window.