Does anyone see an issue with this code? I am getting Error #1068: int
and Boolean cannot be reconciled at the line "var val:String =
speedtype(amount);" My SpeedType is actually in a utility function but
after getting this error I placed the SpeedType function definition in
the same file as the lineChart_dataTipFunction but I still get the
same error.
TIA
Using Flash player 10 with Flex 3.1.
XML for this code ---------------------------
<myXML>
<Item id="4" band="50000000" cap="100000000">
<usage time="06:10:52" amount="9891" />
<usage time="07:10:52" amount="8822" />
<usage time="08:10:52" amount="11801" />
<usage time="09:10:52" amount="7801" />
<usage time="10:10:52" amount="6877" />
<usage time="11:10:52" amount="9999" />
</Item>
<Item id="4" band="55955" cap="1000000">
<usage time="06:10:52" amount="9700" />
<usage time="07:10:52" amount="7777" />
<usage time="08:10:52" amount="1001" />
<usage time="09:10:52" amount="5501" />
<usage time="10:10:52" amount="5557" />
<usage time="11:10:52" amount="1111" />
</Item>
</myXML>
End XML ---------------------------------------------
Begin code----------------------------------------------------------
private function lineChart_dataTipFunction(item:HitData):String {
var cSI:LineSeriesItem = item.chartItem as LineSeriesItem;
var col:String = LineSeries(item.element).yField;
var amount:Number = Number([EMAIL PROTECTED]);
var val:String = SpeedType(amount);
return String("<b>Time: </b>" + [EMAIL PROTECTED] + "<br />"
+ "<b>Usage (</b>" + val + "<b>): </b>" + [EMAIL PROTECTED]);
}
public function SpeedType(speed:Number):String {
var sp:Number = speed;
var str:String = "";
if (sp > 1000000000000 && sp <= 100000000000000){
return str = "Tbs";
}else if (sp > 1,000,000,000 && sp <=
1,000,000,000,000){
return str = "Gbs";
}else if (sp > 1000000 && sp <= 1000000000){
return str = "Mbs";
}else if (sp >1000 && sp <= 1000000){
return str = "Kbs";
}else{
return str = "bs";
}
}
End code ------------------------------------------------------