I have the following code so I can use the var "qst" in another function. But when I run it I get an error
"1136: Incorrect number of arguments. Expected 1" for this line button();
Do I have to put an argument in button(); for this to work? Many thanks
var myDateDay:Date = new Date();
var dayNumber:int = myDateDay.day;
var qst:XML;
var qstLoader:URLLoader = new URLLoader();
qstLoader.load(new URLRequest("default.qst"));
qstLoader.addEventListener(Event.COMPLETE, processQST);
// Process QST file;
function processQST(e:Event):void {
qst = new XML(e.target.data);
trace(qst);
button();
}
myButton.addEventListener(MouseEvent.CLICK, button);
function button(event:MouseEvent):void {
var question:XMLList = qst.question.(@day == dayNumber).text;
trace(question);
}