View Full Version : one variable greater than other, do this
e39m5
10-23-2005, 12:35 AM
This is the code i came up with
if("spaceCount" > "clickCount"){
winner = "The SpaceBar!";
};
if("clickCount" > "spaceCount"){
winner = "The Mouse!";
};
but it always returns The SpaceBar in my dynamic textbox. clickcount and spacecount are both variables with numbers
e39m5
piratefish
10-23-2005, 12:40 AM
When you put quotes around it, it becomes a String. Just a bunch of letters.
Quick Thing: "Num" is a string. Num is a variable which can be further defined by using var Num:Number. That makes it so that the variable Num can only hold numbers.
e39m5
10-23-2005, 12:50 AM
Wow, super speedy response. First AS forum I found with that.
ok, when i take out the quotes, it doesn't put anyhting in the dynamic text box. New code:
stop();
if(spaceCount>clickCount){
winner = "The SpaceBar!";
};
if(clickCount>spaceCount){
winner = "The Mouse!";
};
I need to stop at that frame, is it affecting anything?
e39m5
e39m5
10-23-2005, 12:53 AM
Woah, scratch that, somehow when i took out those quotes, my text box got deleted. Thanks!
e39m5
piratefish
10-23-2005, 01:11 AM
You aught to do a bit of research in some of the beginner tutorials here. They're absolutely amazing.
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.