flash calculations
- Started
- Last post
- 1 Response
- Inkyfingers
I have a little movie which has 11 btns each adds 2 numbers to 2 dynamic text boxes and the total adds up. If the btns are selected again then it subtracts the number from the total. The problem lies with decimal numbers ie 1.6 etc. The total starts coming up with random numbers but its ok with whole numbers?
Any ideas? Here is the script:
on (release) {
if (_global.sIcon2_On == 0) {
tellTarget ("on_off") {
gotoAndStop(2)
_global.sIcon2_On = 1;
_global.Total_1 = _global.Total_1 + 4.0;
_global.Total_2 = _global.Total_2 + 294;
_parent._parent.input3 = _global.Total_1;
_parent._parent.input4 = _global.Total_2;
}
} else {
tellTarget ("on_off") {
gotoAndStop(1)
_global.sIcon2_On = 0;
_global.Total_1 = _global.Total_1 - 4.0;
_global.Total_2 = _global.Total_2 - 294;
_parent._parent.input3 = _global.Total_1;
_parent._parent.input4 = _global.Total_2;
}
}
}
- Inkyfingers0
anyone kind enough to have a look?