-
1. Re: Check input text to correct decimal point?
elainefinnell Jan 22, 2014 10:47 AM (in response to rossfranks)Hi, pancreasboy-
It's unclear to me what you're trying to check in the text box. Are you trying to check that the student has the right number of significant digits, or are you trying to check that the student entered the correct value?
Also, there's no way to create input text boxes using the text field right now. Fundamentally, they're different tags. You'll need to write your input form elements in the project's HTML and then open it again in Animate.
Hope that helps,
-Elaine
-
2. Re: Check input text to correct decimal point?
rossfranks Jan 22, 2014 2:54 PM (in response to elainefinnell)Sorry Elaine I didn't explain that too well did I?
Just pretend that 1st text box has nothing in it (I was just showing what the answer could be, ie the answer is within a small range, see code below), so the student will enter their answer into that text box and then press the check button to see if they got that 1st text box answer correct.
So I'd need to know how to generate a input text box, then get it to check some input text (to the correct decimal point) when clicking the check button.
Basically this project was done in Flash and I'm transplanting it over into Edge, my code for Flash was...
this.KHP.text = ("0.0____");
onCheck.onPress = function() {
var Answer:Number = 0;
if(KHP.text.length==7&&(KHP.text)>0.09950&&(KHP.text)<0.09955){
Answer = 1;
if (Answer == 1) {
// _global.gKHP will be displayed as static text from now on in this first text box
_global.gKHP = KHP.text;
gotoAndStop("calc3");
} else {
// A restart button appears
onRestart._visible = 1;
KHP.text = "Incorrect";
}
};
Hope that explains things a bit better.
-
3. Re: Check input text to correct decimal point?
elainefinnell Jan 23, 2014 12:03 PM (in response to rossfranks) -
4. Re: Check input text to correct decimal point?
rossfranks Jan 23, 2014 4:27 PM (in response to elainefinnell)Thanks Elaine,
here's my attempt...
http://twistedpancreas.com/edge/text/inputText.zip
although I kind of got lost in that post, and couldn't really see how to get the code to check the character length of text typed into the text box, or whether it was in the specified range.
Any help would be appreciated.
-
5. Re: Check input text to correct decimal point?
rossfranks Jan 27, 2014 8:34 PM (in response to rossfranks)Hopefully I made sense, anyone?
-
6. Re: Check input text to correct decimal point?
hemanth kumar r Jan 27, 2014 11:39 PM (in response to rossfranks)Hi,
I have modeified the files to match your use case.
Let me know if you have any doubts on modification.
Hopefully this will be useful
https://drive.google.com/file/d/0B2k82B_Y-fXCYjF6WkJfUjVwczA/edit?usp=sharing
-
7. Re: Check input text to correct decimal point?
rossfranks Jan 28, 2014 4:25 PM (in response to hemanth kumar r)Thanks rhemanthkumar, that exactly it.
You're a lifesaver!
And thanks Elaine for your help too!




