# Red or black?

**URL:** <https://forum.kirupa.com/t/red-or-black/225312>\
**Category:** Uncategorized\
**Created:** [May 10, 2007, 4:23pm UTC](https://forum.kirupa.com/t/red-or-black/225312 "2007-05-10T16:23:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dayglowdave](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@dayglowdave](https://forum.kirupa.com/u/dayglowdave)\
**Post date:** [May 10, 2007, 4:23pm UTC](https://forum.kirupa.com/t/red-or-black/225312/1 "2007-05-10T16:23:59Z")

</div>

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]*//&lt;-- 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] &lt; [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]"&lt;b&gt;"[/COLOR] + [COLOR=#0000FF]this[/COLOR].[COLOR=#000080]currBalance[/COLOR] + [COLOR=#FF0000]"&lt;/b&gt;"[/COLOR];

```

[COLOR=#000000]}[/COLOR]  
[/LEFT]  
[/FONT]

Cheers
