This content has been marked as final. Show 5 replies
How about storing the keystrokes in a global string? Something like this:
gKeyString = “”
password = “abracadabra”
gKeyString = gKeyString & _key.key
if gKeyString.length > password.length then
gKeyString = chars (gKeyString, gKeyString.length-password.length, gKeyString.length)
if gKeyString = password then
go frame “secretPlace”
I've not tested this code but it should work with little or no modification.
Thankyou, im still getting an error message....
Script error: Variable used before assigned a value
gKeyString - gKeyString&key.?key
try replacing _key.key with the key
I tested it with both _key.key and the key, it works either way. Make sure the line reads: gKeyString = gKeyString & _key.key, don't forget the underscore. Also, if you're testing in the authoring environment you must click on the stage and bring it forward to allow the on keyDown handler to work.