Newgrounds.com — Everything, By Everyone.

Checking login status…

USERNAME:

PASSWORD:

Logging in…

Logged in as:
.
Logging out…
Inbox My Account Log Out


Forum Topic: Quick question!

(53 views • 2 replies)

This topic is 1 page long.

<< < > >>
Happy

TaroNuke

Reply To Post Reply & Quote

Posted at: 6/6/08 06:10 PM

TaroNuke LIGHT LEVEL 15

Sign-Up: 10/05/05

Posts: 117

I solved the HUD stick problem, and it works so much better than it would have worked
if I had used a V-cam.

Now, I just want some code for "Is a number".

I know there's a function, I just don't know that function.

i.e. if (something = a number)

as opposed to text. Thanks in advance.


None

johnfn

Reply To Post Reply & Quote

Posted at: 6/6/08 08:33 PM

johnfn LIGHT LEVEL 19

Sign-Up: 08/16/03

Posts: 2,852

Well that depends.

If you're thinking something along of the lines of a variable could be passed to a function, and that variable could either be of type Number or String, use if (var instanceOf Number).

If you have no idea what I'm talking about, then try int(yourNum). if yourNum is a string with anything except a number, it will be 0. Otherwise, it will be the value of the number.


Goofy

zrb

Reply To Post Reply & Quote

Posted at: 6/6/08 08:38 PM

zrb LIGHT LEVEL 09

Sign-Up: 08/08/06

Posts: 3,820

i.e. if (something = a number)

I think this is what you want.

if(variableName == #) {
//stuff
}

Replace "#" by a number.

I can speak french :3 || As :Main || As3: Main || Animation: Main || Flash Tutorials ||

BBS Signature

All times are Eastern Daylight Time (GMT -4) | Current Time: 10:29 PM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!