I was messing around with JavaScript prompts (based on an example by Pertex), and discovered something rather odd. Here is the script:
<start type="script">
question = "What is your name?"
default = "Anonymous"
request (RunScript, "jsinputbox;"+ question +";"+default + ";NameOutput")
on ready {
question = "How old are you?"
default = "0"
request (RunScript, "jsinputbox;"+ question +";"+default + ";AgeOutput")
}
</start>
What is strange is that the player is asked his age first, and then his name, despite the
on ready command.
File:
Struggling to upload the JavaScripot file, so this is the content:
function jsinputbox(question, def, callback) {
var answer = prompt(question, def);
ASLEvent(callback, answer);
}