Saturday, 22 October 2011

WEEK 5 : Dialog Box

The next task is to create a dialog box question.





1.  Create this layout using Text Tool (T)



2.  Then, click Window ----> components ----> combo box


3.  Rename the combo box by name box
4. Click Window ----> Component Inspector

5. Choose Data
6. Key in the above data

Behind the button submit, insert this action script

on (press) {
    if (box.getValue() == "pertama") {
        respon = "kurang tepat. sila cuba lagi!";
}
if (box.getValue() == "kedua") {
        respon = "Tahniah!Jawapan anda betul";
}
if (box.getValue() == "ketiga") {
        respon = "kurang tepat. sila cuba lagi!";
}
if (box.getValue() == "keempat") {
        respon = "kurang tepat. sila cuba lagi!";
}
if (box.getValue() == "kelima") {
        respon = "kurang tepat. sila cuba lagi!";
}

gotoAndStop(2);

}
 Insert stop action on the first frame.

On the frame 2, create this layout.


For the dialog box, make sure to use Dynamic Text and Var : respon
Link the back button to the frame 1.

No comments:

Post a Comment