I’m working on updating a quiz game; everything was already there, someone else programmed it. A problem I’m encountering, which is thankfully now, the last of many problems, is that at the very end of the test, you’re shown your score, and you have the option to type your name in a text box and click “save”. Doing so will apply you score data (time elapsed, date, correct answers and percentage) along with the name you typed in, and output in a form, that you can save or print off, or whatever. The problem is, the input text box will not let you type in it. If you mouse over it, the mouse stays a pointer, you don’t get the text tool. If you click on it, the cursor appears for a split second after you release the mouse button, but you cannot type anything in it.
This is the actionscript for the output form:
//
function saveRecord(record:String, field:String, now:Object, score:Object):Void {
var so:Object = Object(SharedObject.getLocal(record));
so.data.record = record;
so.data.field = field;
so.data.now = now;
so.data.score = score;
so.flush();
}
//
function loadRecord(record:String, score:Object):Object {
return Object(SharedObject.getLocal(record)).data.score;
}
function getnow(record:String, now:Object):Object {
return Object(SharedObject.getLocal(record)).data.now;
}
//
//
saveNowTime_txt.text = TestTime;
saveFieldName_txt = "Driving Test";
saveDateValue = dateTextField;
saveFieldValue = "Your driving IQ was "+intResultTest+"%";
saveFieldValue_var = "Your driving IQ is "+intResultTest+"%";
loadFieldValue_txt.text = loadRecord(saveRecordName_txt.text, saveFieldName_txt.text);
loadFieldDate_txt.text = getnow(saveRecordName_txt.text, saveFieldName_txt.text);
//
//
btnContinue.onRelease = function() {
saveRecord(saveRecordName_txt.text, saveFieldName_txt, saveDateValue, saveFieldValue);
Display.gotoAndStop("Reset");
gotoAndStop("startFrame");
};
if (saveRecordName_var == "" || saveRecordName_var == undefined) {
warningMsg2 = "Enter your name,
no \"spaces\", please";
} else {
warningMsg2 = "Your score is saved...";
}
//
Everything looks in order, all the variables are correct, the input text box is set to input - it just wont let you write in it. I even went into a blank project, created a rudimentary setup, with an input text box one frame and a button, with the simple script:
outputName=inputName;
Setup a button that moved to the frame with the designated output dynamic text box, tested it, it worked. So I tried moving the input box to the program - will not work… It does the same thing, cannot type in it. I tried moving the text box to a different frame, used the simpler script to output, made no difference.
Does anyone have any ideas why it’s doing this?