multiply values from an XML document

Filed under: nnxj.com — mike @ March 16, 2010 edit
Oh man people. I'm stuck and have been pulling my hair out for hours. PLEASE HELP!!!

I have set up an XML document and and array inside flash to read the values into. No problems so far.. The array looks like this: _global.cal[0];

When i get the value of _global.cal[0] , i get a number.. in this case its 150. no problems here. but when i try to multiply that number by 5 (_global.cal[0]*5) I get an NaN... So i tried Number(_global.cal[0]) but nothing... along with just about every combination of using int() or NUmber() that i could.

go to http://www.jarretgabel.com/vending (http://www.jarretgabel.com/vending) , click through the dairy button, and you'll see the tests that i am running to figure this out.. it's really frustrating.

I'm initializing my arrays like this:
_global.cal = new Array(totalslides);

setting my array up with this:
_global.cal[i] = counter.firstChild.nextSibling.nextSibling.nextSib ling;

and testing with these:
extra = _global.cal[0];
extraA = Number(_global.cal[0]);
extraB = _global.cal[0]*5;
extraC = Number(_global.cal[0])*5;
extraD = Number(_global.cal[0]*5);
but only first one returns a value of 150...

I have no idea what i'm doing wrong... please help!




#If you have any other info about this subject , Please add it free.#
Your name:
E-mail:
Telphone:

Your comments:


If you have any other info about multiply values from an XML document , Please add it free.