Copy link to clipboard
Copied
Hi all,
On my second question frame I have a dynamic text field (pLvl1Qu2txt) which seems to be the cause of the error 1086 and 1084. When I delete the dynamic field, it gives me an error to say its missing instead of the errors above.
The location of the problem is on layer 'test', frame 20. I don't have any script on the test layer, its all in the actions layer.
The code on the actions layer is;
//random numbers between 10 - 20 for question
var pLvl1Qu2RanNu1: Number = 10 + Math.floor(Math.random() * 11);
var pLvl1Qu2RanNu2: Number = 10 + Math.floor(Math.random() * 11);
//question
pLvl1Qu2txt.text = "You have been given £" + pLvl1Qu2RanNu1 + ". How much more do you need to get £" + pLvl1Qu2RanNu2 + "?";
//on click, check answer
btnPLvl1Q2Check.addEventListener(MouseEvent.CLICK, pLvl1Q2Check);
function pLvl1Q2Check(event: MouseEvent): void {
if (pLvl1Ans2.text == pLvl1Qu2Equal) { //pLvl1Ans2 is what the user inputs
pLvl1Ans1Text.text = "Well done! You got it right!";
pLvl1AnsStar2_mc.visible = true;
pLvl1Ans2Text.visible = true;
pLvl1S2_mc.visible = true;
btnPLvl1Q2Check.visible = false;
btnPLvl1Qu2Next.visible = true;
} else {
pLvl1Ans2Text.text = "Sorry! You got it wrong this time!";
pLvl1AnsStar2_mc.visible = true;
pLvl1Ans2Text.visible = true;
pLvl1SadS2_mc.visible = true;
btnPLvl1Q2Check.visible = false;
btnPLvl1Qu2Next.visible = true;
}
}
The full errors are:
plusLvl1, Layer 'test', Frame 30 | 1086: Syntax error: expecting semicolon before multiline. |
plusLvl1, Layer 'test', Frame 30 | 1084: Syntax error: expecting rightbrace before semicolon. |
I seem to have fixed it.
For anyone else who may get this issue;
I deleted the dynamic text field, drew another and named it the same. All works fine now!
Copy link to clipboard
Copied
I seem to have fixed it.
For anyone else who may get this issue;
I deleted the dynamic text field, drew another and named it the same. All works fine now!