On week 6, we continue our lesson with text entry question.
1. Create several layers as following and rename each of the layer with an appropriate name.
2. In layer bg, draw an object to acts as a background of the application. For example, you can draw 3 rectangles to act as a background as the followings.
3. In layer text1, type the following text:
4. In layer text2, type the following text:
5. In layer step, type the following text:
6. In layer question, type the question.
7. Please use the following types of Text for each text field in layer question:
1. Create several layers as following and rename each of the layer with an appropriate name.
2. In layer bg, draw an object to acts as a background of the application. For example, you can draw 3 rectangles to act as a background as the followings.
3. In layer text1, type the following text:
4. In layer text2, type the following text:
5. In layer step, type the following text:
6. In layer question, type the question.
7. Please use the following types of Text for each text field in layer question:
9. In layer stop, type the following actionscript:
var respon;
var answer;
respon = ""
answer = ""
stop ();
10. Behind Pause button, type the following actionscript:
on (release) {if (answer == "carbon monoxide and other hydrocarbons")
{respon="Correct";
} else {
respon="Incorrect. Your answer "+answer+"is incorrect";
}
}
11. If you want your application accept Enter key press, edit the script as following:
on (release, keyPress "<Enter>") {if(answer=="carbon monoxide and other hydrocarbons") {respon="Correct";
} else {
respon="Incorrect. Your answer "+answer+"is incorrect";
}
}
12. Behind Play button, type the following actionscript:
on(release) {gotoAndPlay("Scene1");
}
The script will bring the application to the first scene if you have the scene!
13. Test the movie an you will get the following view:
No comments:
Post a Comment