pass a number value to a Timer, XML and AS3

Posted by VideoDnd on Stack Overflow See other posts from Stack Overflow or by VideoDnd
Published on 2010-03-24T19:43:51Z Indexed on 2010/03/24 19:53 UTC
Read the original article Hit count: 279

Filed under:
|
|

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);

© Stack Overflow or respective owner

Related posts about flash

Related posts about Xml