Murphos Murphos - 1 year ago 143
ActionScript Question

Actionscript 3; error 1086

Currently coding a game in Actionscript 3, and the following function keeps spitting out this error;

function checkAnswer(e:KeyboardEvent):void{
var input:String(this.userInput.text).toLowerCase();
var currentLetter:int;
var currentWord = currentFruit;
while (currentLetter < input.length){
if (this.currentWord.charAt(currentLetter) == input.charAt(currentLetter)){
} else {


And the error;

Scene 1, Layer 'Actions', Frame 1, Line 81 1086: Syntax error: expecting semicolon before leftparen.

I have no idea why it is doing this. Does anyone have any clue? Can anyone help?

Answer Source


 var input:String(this.userInput.text).toLowerCase(); 


var input:String = this.userInput.text.toLowerCase();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download