pass a number value to a Timer, XML and AS3
- by VideoDnd
I want to pass a number value to a Timer. How do I do this? My number and integer values for other variables work fine.
Error
I get null object reference and coercion of value, because I'm not passing to 'timer' properly. I don't want to say my variable's a number, I want to say it has a number value.
Variable
//what I have now
var timer:Timer;
timer = new Timer(100);
Path
myXML.COUNT.text();
XML
<?xml version="1.0" encoding="utf-8"?>
<SESSION>
<TIMER TITLE="speed">100</TIMER>
</SESSION>
Parse and Load
//LOAD XML
var myXML:XML;
var myLoader:URLLoader = new URLLoader();
myLoader.load(new URLRequest("time.xml"));
myLoader.addEventListener(Event.COMPLETE, processXML);
//PARSE XML
function processXML(e:Event):void {
myXML = new XML(e.target.data);