Groups | Blog | Home
all groups > flash actionscript > february 2004 >

flash actionscript : define variable problem


grover970
2/19/2004 10:45:15 PM
I am attaching values to a array from XML.
When I trace the variable the output gives me the values, no problem so far.

the values are always going to be an integer.
The problem is, when I create a if statement looking for a specific value,
flash just skips over it.

The number value from the XML is already a string, correct? So, I don't see
the need to convert it to a integer. I am very confused.

here is what I got so far:
//finish is the node value in the XML
var finish = eventData.finish;
if (finish == "1") {
var medalColor = new Color (eventMenuItem);
medalColor.setRGB(0xFF3300);
}
Pea
2/19/2004 11:59:15 PM
So when you trace(finish) you get '1' ?

Have you tried to convert it to an integer anyway, to see if it works?
Also, have you checked for spaces that could be before or after the values?
e.g. "1 " - try trimming the 'finish' string first..

Hope it helps,
Peter
grover970
2/20/2004 3:19:08 PM
Yes when I trace (finish), I get a value for each item in the array. Depending
on the value, (1) in this case, will define the color of the array. If I don 't
use an if statement, and just go ahead and change the color for all the items
it works fine. But I need specific items to be specific colors.
AddThis Social Bookmark Button