Alright for a very simple project I am building a money balance reporter. The idea is to have the current balance be in red if the balance is below $0. And black if it is greater than zero. For a brief moment I had it working and I swear I didn’t change the code but I must have because now it isn’t working. Can anyone help me out?
ActionScript Code:
[FONT=Courier New][LEFT]myBalance = [COLOR=#000000]**new**[/COLOR] [COLOR=#0000FF]LoadVars[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
myBalance.[COLOR=#0000FF]load[/COLOR]COLOR=#000000[/COLOR];
myBalance.[COLOR=#0000FF]onLoad[/COLOR] = [COLOR=#000000]function[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000]{[/COLOR]
redOrBlack = [COLOR=#000000]**new**[/COLOR] [COLOR=#0000FF]Color[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]_root[/COLOR].[COLOR=#000080]currBal[/COLOR][COLOR=#000000])[/COLOR]; [COLOR=#808080]*//<-- function that sets currBal to currBalance and decides whether you are in the red or black.*[/COLOR]
[COLOR=#0000FF]if[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]this[/COLOR].[COLOR=#000080]currBalance[/COLOR] < [COLOR=#000080]0[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000]{[/COLOR]
redOrBlack.[COLOR=#0000FF]setRGB[/COLOR][COLOR=#000000]([/COLOR]0xFF0000[COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR][COLOR=#0000FF]else[/COLOR][COLOR=#000000]{[/COLOR]
redOrBlack.[COLOR=#0000FF]setRGB[/COLOR][COLOR=#000000]([/COLOR]0x000000[COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#0000FF]_root[/COLOR].[COLOR=#000080]currBal[/COLOR].[COLOR=#0000FF]htmlText[/COLOR] = [COLOR=#FF0000]"<b>"[/COLOR] + [COLOR=#0000FF]this[/COLOR].[COLOR=#000080]currBalance[/COLOR] + [COLOR=#FF0000]"</b>"[/COLOR];
[COLOR=#000000]}[/COLOR]
[/LEFT]
[/FONT]
Cheers