dialog input should not be a string!

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
payton
Posts: 10
Joined: January 30th, 2009, 4:11 pm

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
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

You can use parseInt(myStartframeValue) to convert strings to whole numbers (use parseFloat() for decimals).

Paul
payton
Posts: 10
Joined: January 30th, 2009, 4:11 pm

wooooha! great.

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

viewtopic.php?f=8&t=1266

thanks!
payton
Post Reply