Ok I am going nuts here. Can use another set of eyes for something
that should be easy. I am overwriting the set data method for my
itemRenderer like so:
//Overrride the set method for the data property so that when
scrolling nothing changes
override public function set data(value:Object):void
{
super.data = value;
if(value != null)
{
var currentValue:Number =
value.perchange;
trace(currentValue);
toolTip=currentValue.toString();
if(currentValue < 0)
{
image.source =
negativeAmountSymbol;
} else if(currentValue >= 0){
image.source =
positiveAmountSymbol;
}
image.source = null;
}
}
}
Here is my data provider:
public var CityData:ArrayCollection = new ArrayCollection([
{
title: "cycle 1", perchange: -32,
revenue:[
{ Month: "Jan", Revenue: 2000 },
{ Month: "Feb", Revenue: 1000 },
{ Month: "Mar", Revenue: 1500 },
{ Month: "Apr", Revenue: 1800 },
{ Month: "May", Revenue: 2400 }
], percentage: 33
},
{
title: "cycle 2", perchange: 33,
revenue:[
{ Month: "Jan", Revenue: 1000 },
{ Month: "Feb", Revenue: 230 },
{ Month: "Mar", Revenue: 1500 },
{ Month: "Apr", Revenue: 2800 },
{ Month: "May", Revenue: 2400 }
], percentage: 15
}
]);
When I run the tooTip shows the perchange Number correctly (-32 and
33), but the images don't show so up in the itemRenderer so according
to my code currentValue must be "null". If take out the "else if"
statement and the image.source=null then it will show the
positiveAmountSymbol because it says it isn't less than 0.
What gives? Thanks in advance.
jason