Hi all.
I’m having some trouble with my xml-input, which is all numbers.
Basicly, the xml feeds number up to one million (1000000) into flash.
Now, I have one movieclip which has the following code:
a little explaination before reading code:
_root.mcMeter.mcNeedle.gotoAndStop(2); makes a needle [COLOR=Lime]green[/COLOR].
_root.sold.gotoAndStop(2); makes text [COLOR=Lime]green[/COLOR].
_root.mcMeter.mcNeedle.gotoAndStop(1); keeps needle [COLOR=Red]red[/COLOR].
_root.sold.gotoAndStop(1); keeps text [COLOR=Red]red[/COLOR].
importXML.onLoad = function(success) {
if(success) {
soldsofar = this.firstChild.childNodes[0].firstChild.nodeValue;
salesgoal = this.firstChild.childNodes[2].firstChild.nodeValue;
louise_avis.mcMeter.setValue(soldsofar);
louise_avis.mcGoal.setValue(salesgoal);
}
if (soldsofar >= salesgoal){
_root.mcMeter.mcNeedle.gotoAndStop(2);
_root.sold.gotoAndStop(2);
} else{
_root.mcMeter.mcNeedle.gotoAndStop(1);
_root.sold.gotoAndStop(1);
}
}
However, if the xml input for “salesgoal” is set to 255000, and the “soldsofar” is set to anything between 26-99 (not 260000 or 990000, but twentysix and ninetynine), flash thinks it’s greater than the “soldsofar”-value. Seems like it does not read the “salesgoal” as the reference-value. But if “soldsofar” exceeds 100 (one hundred), it goes back to red.
So what I’m looking for is a way to define a scale which is based on “salesgoal”, because now flash reads “salesgoal” 255000 as 25.5 until “soldsofar” exceeds 100.
Anybody?