Sei sulla pagina 1di 19

1. Click on ActionScript 3.

2. Set the size from (550 x 400) to 600 x 350.


3. Change the stage colour to #000033

4. Rename the Layer 1 to BG (To edit layer name, double click it).

5. Use the Rectangle Tool (R as shortcut) to drag a rectangle about this.


6. Use the Selection Tool (V as shortcut) to click the rectangle created and set the
background to this colour.

7. Create a new layer and rename it to TEXTS.


8. Click on Text Tool (T as shortcut), Make sure the default settings are Classic Text and
Static Text, change the Color to White, choose any Fonts & Font-size you like and change
style to Bold.

9. By using the Text Tool (T as shortcut), click and drag for a text box and then type in the
title. (You can use Selection Tool (V as shortcut) to drag the textbox to the area you like)
10. Create another textbox by using Text Tool (T as shortcut), type in as follow and set the
alignment to Center (Paragraph > Format > Align Center), then click on Color, change to any
color you like.(You can use Selection Tool (V as shortcut) to drag the textbox to the area you
like)

11. Lock the background by clicking the “DOT” in BG’s Layer, Click on TEXTS’s layer then
use Rectangle Tool(R as shortcut) to create a red rectangle as shown. You can change the
color of the rectangle inside the setting panels of Fill and Stroke.
12. Use Text Tool (T as shortcut) to create a textbox inside the red rectangle and type in
“PLAY”.

13. Use the Selection Tool (V as shortcut) to select whole PLAY button, right click the button
after the button is selected, choose Convert to Symbol (Make sure it is Button, not Movie
Clip), set the Name and the Instance Name in setting panel as playbtn.

14. Use the Selection Tool (V as shortcut) to double click the PLAY button to open up
keyframe settings.

15. Click on the Up Frame, press F6 till a black dot show in Hit Frame.

16. Click on the Over Keyframe, reset the selection by clicking outside of the button, click the
button again, change the color from Red to Yellow. Repeat this step for the fourth Keyframe.

17. Double click on the gray space to come out from the keyframe settings.

18. Click on the ‘1’,press F6 to generate another Keyframe, you will get a vertical rectangle
for your BG layer, click the rectangle and press F6 to change it to a Keyframe.

19. Click on 2nd Keyframe, use the Selection Tool (V as shortcut) to select the PLAY button
and delete it.
20. Use Text Tool (T as shortcut) to click on “WELCOME ……” textbox and change the text
to “ENTER YOUR NAME TO START”.

21. Use the Text Tool, change Static Text to Input Text and create a textbox.

22. To show the border of the textbox, click the icon as shown in the picture.

23. Click the textbox, Embed > Tick (All, Uppercase, Lowercase) in the Character Ranges
setting > Ok.
24. Use the Rectangle Tool (R as shortcut) to create another button and change the color to
Red.

25. Use Text Tool (T as shortcut) to create a textbox, change the Input Text back to Static
Text and type START.

26. Use Selection Tool (V as shortcut) to select the button and convert it to symbol. Name is
as startbtn, same goes to the instance name as well. Repeat Step 14 - 17.

27. Create another new Keyframe and repeat Step 18 but this time,we click on ‘2’ or the 2nd
Keyframe.

28. Use Selection Tool (V as shortcut) to click and select the area of the textbox and the
start button, delete it.

29. Use Text Tool (T as shortcut) and click the “ENTER…” to change the text to your first
question.
30. Use the Rectangle Tool (R as shortcut) to create a rectangle as your option. Use
Selection Tool (V) to select and Ctrl+C then Ctrl+V to paste it.

31. Use Text Tool (T) to create a textbox and type in the answer “1”. Copy & Paste the
textbox and then put in another answer as “2”. Drag them into your rectangle “option” box.

32. Select the “1” rectangle “option” and convert them to symbol. Name it as q1a, instance
name as q1a too. (Make sure it is Button, not Movie Clip)

33. Repeat Step 32 for option “2”. (Make sure it is Button, not Movie Clip)

34. Create another new keyframe in frame 4. Repeat Step 18 to make sure both keyframe in
frame 4 are Black Dot.

35. Use the Selection Tool (V) to select the options button and delete them.
36. Double click the text from “WHAT IS 1 + 1 ?” to “WHAT IS 1 + 2 ?”

37. Use Rectangle Tool (R) to create options again.

38. Use Tool Text (T) to create the text.

39. Use Selection Tool (V) to move the text into the options rectangle.

40. Convert the options into symbol by using Selection Tools. Name them as q2a and q2b,
same goes to the instance name as well.

41. Create another new keyframe in frame 5. Repeat Step 18 to make sure both keyframe in
frame 5 are Black Dot.
42. Use Text Tool (T) to change the question from 1 + 2 to 2 + 2 and options A “3” to “4”.
43. Use Selection Tool to select and convert the options button to symbol. Name and
Instance Name as q3a and q3b.

44. Add another keyframe by selecting Frame 5 and then press F6. Click the rectangle frame
shown in Frame 6 and press F6 to change it to Keyframe.

45. Use Text Tool (T) to change the question from 2+2 to “HERE YOUR RESULT”.

46. Use Selection Tool (V) to select the options and delete them.

47. Use Text Tool (T) , change static/input text to Dynamic Text.
48. Set the instance name as nameres (name reserved) and disable the border. See Step 22
to see how to enable and disable the border.

49. Create another Dynamic Text again that will hold your score by using Text Tool (T),set
the instance name as scoreres and disable the borders. (Check Step 22 to see how to
enable/ disable border)

50. Go back to frame 3 and double click option “1”.


51. Add 3 Keyframes by pressing F6 3 times.

52. On 2nd Keyframes, use Selection Tool (V) to reset the selected area by clicking grey
areas and select the button again, change the color from Yellow to Red. Repeat this step for
the fourth Keyframe as well.

53. Double click grey area to return to the normal scene.

54. Repeat step 50 - 53, but this time double click option “2”. (You can do this for all the
options)

55. Use Text Tool (T) , make sure the setting are Classic Text and Static Text and create
question number as shown in the picture on the top right.
56. Use Text Tool (T) , change the Static Text to Dynamic Text and create Time as shown in
the picture on the top left. Set the instance name to timecd.

57. Shift + Click the Time and the Question Number, copy it and paste it into the second
question and 3rd question. Change “1 out of 3 questions” to “2 out of 3 questions” and “3 out
of 3 questions”.

58. Create a new layer and name it ACTIONS.

59. Set your Red Highlight back to Frame 1 and then press F6 till there are 6 circles.

60. Select the first ACTIONS layer’s circle, Right Click > Actions

61. Copy and paste the code into the first circle’s action script

stop();
playbtn.addEventListener(MouseEvent.CLICK,play2);

function play2 (event:MouseEvent):void


{
gotoAndStop(2);
}
62. Copy and paste the code into the second circle’s action script

stop();
var player:String;
var score:int = 0;
var completed:int = 0;

startbtn.addEventListener(MouseEvent.CLICK, startbtn3);
function startbtn3(event:MouseEvent):void
{
player = playerName.text;
var fl_SecondsToCountDown_2:Number = 5;
var fl_CountDownTimerInstance_2:Timer = new Timer(1000,
fl_SecondsToCountDown_2);
fl_CountDownTimerInstance_2.addEventListener(TimerEvent.TIMER,
fl_CountDownTimerHandler_2);
fl_CountDownTimerInstance_2.start();

function fl_CountDownTimerHandler_2(event:TimerEvent):void
{
timecd.text = (fl_SecondsToCountDown_2 + " seconds left");
fl_SecondsToCountDown_2--;
if( fl_SecondsToCountDown_2 == 0 )
{
fl_CountDownTimerInstance_2.stop();
gotoAndStop(6);
outText.text = "Sorry your time is up! here is your result";

}
if( completed == 1 )
{
fl_CountDownTimerInstance_2.stop();
timecd.text = "Completed!";
}

}
gotoAndStop(3);
}

/* Deactivate/Activate Event
Conserve CPU and battery life by suspending expensive processes,
such as ENTER_FRAME and TIMER events, when the application is not in
focus.

Instructions:
1. Start timers and add event listeners in "fl_Activate".
2. Stop timers and remove event listeners in "fl_Deactivate".
*/
/*
stage.addEventListener(Event.ACTIVATE, fl_Activate);
stage.addEventListener(Event.DEACTIVATE, fl_Deactivate);

function fl_Activate(event:Event):void
{
// Start timers and add event listeners here.
}

function fl_Deactivate(event:Event):void
{
// Stop timers and remove event listeners here.
}
*/

63. Copy and Paste for the third

stop();
q1a.addEventListener(MouseEvent.CLICK, nextq1a);

function nextq1a(event:MouseEvent):void
{

gotoAndStop(4);
}
stop();
q1b.addEventListener(MouseEvent.CLICK, nextq1b);

function nextq1b(event:MouseEvent):void
{
score = score +1;
gotoAndStop(4);
}

64. Copy and paste for the fourth

stop();
q2a.addEventListener(MouseEvent.CLICK, nextq2a);

function nextq2a(event:MouseEvent):void
{
score = score +1;
gotoAndStop(5);
}
stop();
q2b.addEventListener(MouseEvent.CLICK, nextq2b);

function nextq2b(event:MouseEvent):void
{

gotoAndStop(5);
}

65. Copy and paste for the fifth

stop();
q3a.addEventListener(MouseEvent.CLICK, nextq3a);

function nextq3a(event:MouseEvent):void
{

gotoAndStop(6);
}
stop();
q3b.addEventListener(MouseEvent.CLICK, nextq3b);

function nextq3b(event:MouseEvent):void
{
score = score +1;
gotoAndStop(6);
}

66. Copy and Paste for the last one

stop();

completed = completed +1;


nameres.text = player;
scoreres.text = score.toString() + " of 3 Points";

strtover.addEventListener(MouseEvent.CLICK, fn_startover);
function fn_startover(event:MouseEvent):void
{
gotoAndStop(1);
}
67. Go to TEXTS layer, Frame 6 and create the blue highlighted rectangle using Text Tool
(T) and make sure it is Classic Text and Dynamic Text. Give it an instance name as outText.

67. Go to TEXTS layer, Frame 6 and create a rectangle by using Rectangle Tool (R as
shortcut). Use Text Tool (T) to create a textbox and write Start Over. Use Selection Tool (V)
to move the text into the rectangle box.
68. Use Selection Tool (V) to highlight and select the rectangle, Right Click > Convert it to
symbol (Make sure it is a button, not a movie clip) . Name is as Startover, instance name as
strtover.

69. Ctrl + Alt + Enter to run the program.