View Full Version : issues with a flash money system, Adding like '7525' where it should be '100'
zach93111
December 17th, 2007, 10:06 PM
I'm sure this is some dumb mistake I made, but... what is causing this is just... hidden...
sum = 0; money = 250; pot = 0; minumum = 25; betCash = 0; card1 = 0; card2 = 0; card3 = 0; card4 = 0; card5 = 0; allowDeal = true; round1 = true; round2 = false; allowNext = false; madeBet = true; message1 = 'Start by clicking "deal"!'; onEnterFrame = function () { if (money=0) { trace(pot) pot += betCash; money -= betCash; madeBet = true; } else { money = 0; message1 = 'cannot bet, you have no cash!'; } }; _root.next1.onRelease = _root.next1.onReleaseOutside=function () { if (allowNext == true) { round1 = false; round2 = true; if (madeBet == false) { money -= minumum; pot += minumum; } } }; }; } };
Jerryscript
December 17th, 2007, 11:42 PM
You should use the PHP code block function rather than the code block function when posting, it works better.
Anyway, I'm not sure from your post exactly what your problem is, but I did see one error:
onEnterFrame = function () {
if (money=0) {
You are setting money equal to 0 instead of checking if it equals 0. It should be
onEnterFrame = function () {
if (money==0) {
Krilnon
December 18th, 2007, 12:31 AM
You should use the PHP code block function rather than the code block function when posting, it works better. Or [code] if you don't mind going though a few seconds of extra work if you happen to make a mistake.
Charleh
December 18th, 2007, 04:48 AM
sum = 0;
money = 250;
pot = 0;
minumum = 25;
betCash = 0;
card1 = 0;
card2 = 0;
card3 = 0;
card4 = 0;
card5 = 0;
allowDeal = true;
round1 = true;
round2 = false;
allowNext = false;
madeBet = true;
message1 = 'Start by clicking "deal"!';
onEnterFrame = function () {
if (money=0) {
trace(pot)
pot += betCash;
money -= betCash;
madeBet = true;
} else {
money = 0;
message1 = 'cannot bet, you have no cash!';
}
};
_root.next1.onRelease = _root.next1.onReleaseOutside = function () {
if (allowNext == true) {
round1 = false;
round2 = true;
if (madeBet == false) {
money -= minumum;
pot += minimum;
}
}
}
Some of this code doesn't really make sense :(
fw2803
December 19th, 2007, 06:13 AM
I spot some really bad errors...
onEnterFrame = function() {
if (money=0) {
}
}
It is not possible to have an equal sign in a condition statement. This may screw up your whole script.
Voetsjoeba
December 19th, 2007, 06:24 AM
When you add the variables, make sure both are actually numbers. Chances are right now one of them is a string, and so Flash adds to the string instead of to the number it represents.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.