So, debugging. The point is to learn literally everything about data and objects you are dealing with. Somewhere along these traces you will see where it is not what you are expecting. The next step is to find out why.
A little research and you will know what makes your script to malfunction. Could possible be either of the following:
- textbox1 is not a TextField instance name but a text variable name, there was such a weird thing in AS1
- the instance name is not textbox1 but maybe TextBox1 and you cannot access it as it is case-sensitive
- textbox1.text is not available because you accidentally have two copies of the same input field with the same instance name
- parseInt is not a function, I don't remember AS1/2 that good, who knows
- the result of parseInt is not what you expect
So:
on (release)
{
// Check if button is working at all.
trace("Release!");
// Check if textbox1 is available.
trace(textbox1);
// Check text contents.
trace("<" + textbox1.text + ">");
// Check if parseInt is a valid function.
trace(parseInt);
myNum = parseInt(textbox1.text);
// Check the result of parsing the text into integer.
trace(myNum);
// Check the condition.
trace(myNum == 2);
if (myNum == 2)
{
// Check if conditional clause works as expected.
trace("Condition Worked!");
gotoAndStop(2);
}
}