Page 1 of 1

dialog input should not be a string!

Posted: February 5th, 2009, 3:00 am
by payton
hi everyone,
my slate creator is close to finish. i will post it here if anyone is interested in it.
but a few features are still missing.

my problem:

Code: Select all

   //Field for Framestart -- then assigns variable
   my_dialog.add("statictext", [10, 210, 240, 230], "Framecounter start at: ");
   var startframeInput = my_dialog.add("edittext", [10, 230, 240, 250], myStartframe);
   startframeInput.onChange = myStartframeValue;
the variable myStartframe alway contains a string. but i need to do math with it. how can i get user input that is stored as numbers instead of strings?

thanks in advance,
payton

Re: dialog input should not be a string!

Posted: February 5th, 2009, 3:36 am
by Paul Tuersley
You can use parseInt(myStartframeValue) to convert strings to whole numbers (use parseFloat() for decimals).

Paul

Re: dialog input should not be a string!

Posted: February 5th, 2009, 6:24 am
by payton
wooooha! great.

maybe you can give me the last advice here ;):

viewtopic.php?f=8&t=1266

thanks!
payton