我正在做一个项目,我连续有 5 张图片。这些图像需要根据 if、if else、else 语句的结果进行更改(红色、黄色、绿色)。我有一些 javascript 可以做到这一点,但我需要在 ActionScript3 中使用它以与 Flex 4.6 一起使用。JavaScript--VV
if ((billableMonthHours/targetMTD) >= 1)
{
MTDstatus.src = "green_led.png";
}
else if (((billableMonthHours/targetMTD) < 1) && ((billableMonthHours/targetMTD) >= 0.95))
{
MTDstatus.src = "yellow_led.png";
}
else //if ((billableMonthHours/targetMTD) < 0.95)
{
MTDstatus.src = "red_led.png";
}
if ((billableQuarterHours/targetQTD) >= 1)
{
QTDstatus.src = "green_led.png";
}
else if (((billableQuarterHours/targetQTD) < 1) && ((billableQuarterHours/targetQTD) >= 0.95))
{
QTDstatus.src = "yellow_led.png";
}
else //if ((billableQuarterHours/targetQTD) < 0.95)
{
QTDstatus.src = "red_led.png";
}
if ((totalRecordedHours-mtdWorkingHours) >= 0)
{
UTDcards.src = "green_led.png";
}
else if (((totalRecordedHours-mtdWorkingHours) >= -4) && ((totalRecordedHours-mtdWorkingHours) < 0))
{
UTDcards.src = "yellow_led.png";
}
else //if ((totalRecordedHours-mtdWorkingHours) < -4)
{
UTDcards.src = "red_led.png";
}
谢谢,我是 JavaScript 和 Flex 的新手。