Name:     ID: 
 
    Email: 

Digital Game Programming Test 1

True/False
Indicate whether the sentence or statement is true or false.
 

 1. 

There are two types of functions you can use in Flash; built-in functions and user-defined functions.
 

 2. 

Built-in functions are defined by Flash and because they are local, they cannot be called by the programmer anywhere in the script.
 

 3. 

A function that is attached to an object is called a method.
 

 4. 

All functions can return a value if they want to.
 

 5. 

It is not possible to use arguments with your own user-defined functions.
 

 6. 

Function arguments are a comma-separated list of variable names which are listed in the function definition. The arguments that are passed to the function when it is called are copied into the variables that appear in the definition.
 

 7. 

User-defined functions can have a return value by using the keyword return.
 

 8. 

In Flash ActionScript, there are two types of scope; block scope and movie-clip scope.
 

 9. 

The black plus symbol is a movie clip registration point.  When you position a clip with the Info Panel or by setting its _x and _y properties, its registration point is placed exactly at the prescribed position.
 

 10. 

The _visible property and the _alpha property are tied together.  Changing one value affects the other value.
 

 11. 

The Flash authoring tool is broken down into panels.
 

 12. 

If you want to collapse all the panels bordering one side of the document, click on the white arrow at the edge of the group of panels to collapse the whole group.
 

 13. 

One way to create a new object in Flash is to insert a new symbol.  Doing this creates a new movie clip that is added to your library.
 

 14. 

To open the library panel, you can use the shortcut keys “ALT + L”
 

 15. 

Because Flash is a vector based tool, you cannot import a rasterized graphic image because Flash does not support bitmap graphics.
 

 16. 

The properties panel shows porperties for a text field when one is selected.
 

 17. 

The playhead’s position on the timeline is identified by its green color.
 

 18. 

A keyframe is a special frame where things change on the stage.
 

 19. 

Each layer can be locked so that any movie clip instances on it cannot be moved or deleted.
 

 20. 

The stacking order of movie clip instances on the stage reflects the ordering of the layers in the timeline.
 

 21. 

ActionScript is now divided into three versions: ActionScript 1.0 (AS 1.0), ActionScript 2.0 (AS 2.0), and ActionScript 3.0 (AS 3.0).
 

 22. 

All versions of Action Script are conveniently based on the ECMAScript standard (ECMA-262) which is a standard based on C++ syntax.
 

 23. 

In Flash CS3, to open the actions panel you would simply select the F8 button or Select Windows from the Menu Bar and Select Actions.
 

 24. 

When a lowercase A appears in a frame, it means that there is a frame label attached to that frame.
 

 25. 

There is no difference between a Symbol name and an Instance name in ActionScript.
 

 26. 

You can attach script to movie clip instances.
 

 27. 

The output panel is a tool to use while developing and testing your movie.
 

 28. 

The key thing about variables is that they allow you to store and manipulate information.
 

 29. 

You can name a variable anything that you want but it is advised that you create a name that makes sense for later use.
 

 30. 

Variable names are not case sensitive in ActionScript.
 

 31. 

A boolean variable is one that can only take one of two values: true or false.
 

 32. 

Numbers are the most common form of data to keep in a variable.
 

 33. 

With an else Conditional only one code block will be executed.
 

 34. 

When Flash sees a break statement in your code, it immediately leaves the current code block and begins executing script one scope above.
 

 35. 

A for loop is generally used when you don’t know how many times the loop needs to iterate.
 

Multiple Choice
Identify the letter of the choice that best completes the statement or answers the question.
 

 36. 

Functions represent an important programming concept which is...
a.
reliability
c.
reusability
b.
flexibility
d.
adaptability
 

 37. 

The organization of functions uses what are called...
a.
methods
c.
properties
b.
objects
d.
all of the above
 

 38. 

To execute a function that is grouped in an object, you refer to the object name, followed by the function name, using...
a.
a variable
c.
dot notation
b.
var
d.
none of the above
 

 39. 

The key to using functions are....
a.
declaring the function
c.
calling the function
b.
function arguments
d.
all of the above
 

 40. 

Consider the following script...

myBase = 2;
for(i = 0; i < 10; ++i){
     myResult = Math.pow(myBase, i);
     trace(“2 raised to the power “ + i +” is “ + myResult);
}

In this example we are calculating all the powers of 2 from....
a.
1-10
c.
i
b.
0-9
d.
both a and c
 

 41. 

Consider the following code and indicate the most correct answer.

function initializeCounter(){
     counter = 1;
     trace(“Counter has been initialized to 1”);
}
function incrementCounter(){
     counter++;
     trace(“Counter has been incremented and its value is now “ + counter);
}
initializeCounter();
for(i = 0; i < 5; ++i){
     incrementCounter();
}
a.
This function will not work
c.
The last initializeCounter invokes both the initializeCounter function and the incrementCounter function.
b.
Counter is equal to 2
d.
Each time initializeCounter is invoked it resets counter to 1 so nothing will be added to counter.
 

 42. 

Consider the following code and indicate the most correct response.

function foo(x){
     x++;
     trace(x);
}
myValue = 10;
foo(myValue);
trace(myValue);
a.
When function foo(x) is called, the variable myValue is passed (copied) to argument x therefore myValue won’t change.
c.
The myValue variable changes when the foo function is called so the final trace function reflects this change.
b.
myValue needs to be the argument when foo is defined and not the value x
d.
none of the above
 

 43. 

Consider the following code and indicate the most correct response.

function division(dividend, divisor){
     myResult = dividend/divisor;
     return myResult;
     trace(“just did division”);
}
myNumber = division(40, 3.6);
trace(myNumber);
a.
The return keyword stops the function and throws you out of the code block.
c.
The “just did division” message will not output
b.
The “just did division” message will be sent to output
d.
both a and c
 

 44. 

Dot notation is the way we indicate....
a.
a possession of something
c.
a possesion or a component of something
b.
a component of something
d.
none of the above
 

 45. 

To indicate that “my kitchen stove is broken”, using dot notation you could write it this way...
a.
stove.kitchen.myHouse
c.
myHouse.kitchen(stove)
b.
myHouse.kitchen.stove
d.
both b and c
 

 46. 

The stage is a Cartesian plane with the origin in ...
a.
the upper-left corner. Positive x goes right, and positive y goes down.
c.
the lower-left corner. Positive x goes right, and positive y goes up.
b.
the upper-left corner. Positive x goes right, and positive y goes up.
d.
the upper-left corner. Positive x goes left, and positive y goes down.
 

 47. 

The _xscale and _yscale properties are initially set to values of 100.  This represents...
a.
the pixel scale.
c.
the position scale.
b.
the percentage of scale.
d.
both a and b
 

 48. 

The this reference is used to
a.
enable a clip to refer to itself
c.
enable a clip to refer to another clip
b.
imply a locally scoped variable
d.
none of the above
 

 49. 

The _parent reference referrs to ...
a.
the _root reference
c.
whatever timeline the clip is instantiated in
b.
the main movie timeline
d.
both a and b
 

 50. 

Consider the following code and indicate the most correct answer.

function foo(){
     trace(“calling foo”);
}
fooReference = foo;
fooReference();

foo();
fooReference();
a.
both function calls will work
c.
you need to trace the fooRefernce to make that work
b.
only the foo(); function call will work
d.
none of the above
 

 51. 

The three types of text fields that Flash supports are...
a.
Static, Dynamic, Graphic
c.
Static, Graphic, Input
b.
Static, Dynamic, Input
d.
none of the above
 

 52. 

By dragging the playhead left and right on the timeline, you can change the currently displayed frame on the stage.  Dragging the playhead is also called...
a.
rubbing
c.
scrubbing
b.
testing
d.
playing
 

 53. 

When a keyframe is present on a timeline, the frame gets a ________________ inside.
a.
blank dot
c.
black dot
b.
empty dot
d.
red flag
 

 54. 

Layers are primarily a method of organizing __________ on your stage.
a.
objects
c.
sound
b.
movie clips
d.
all of the above
 

 55. 

When you create a new layer, the first frame will always be a _______________.
a.
Blank Keyframe
c.
Keyframe
b.
Blank Frame
d.
Empty Frame
 

 56. 

You can give a frame a name.  When you do this, a small ____________ appears in the frame you labeled.
a.
dot
c.
empty dot
b.
red flag
d.
none of the above
 

 57. 

____________ are essentitally breaks in your timeline in which the numbering of frames starts over at 1 again.
a.
Keyframes
c.
Frame Labels
b.
Blank Keyframes
d.
Scenes
 

 58. 

Tweening is a tool that creates ___________ in Flash.
a.
Animation
c.
Both A and B
b.
Motion
d.
none of the above
 

 59. 

The default stage size is....
a.
550 x 400
c.
800 x 600
b.
640 x 480
d.
1200 x 768
 

 60. 

The speed of your movie is controlled by ....
a.
code
c.
cpu speed
b.
frames per second
d.
all of the above
 

 61. 

You can attach script...
a.
to any frame of your main movie timeline
d.
all of the above
b.
to movie clip instances
e.
none of the above
c.
to frames in the timelines of movie clips in your library
 

 62. 

The most common location to put a script is in ...
a.
any Keyframe in any timeline
c.
any frame on any timeline
b.
any Blank Keyframe in any timeline
d.
both A and B
 

 63. 

Given the following script...
ball1._xscale = 200;
a.
This script causes the instance on the stage called ball1 to immediately stretch its width by 200 percent.
d.
Both A and C
b.
This script causes the instance on the stage called ball1 to immediately stretch its height by 200 percent.
e.
none of the above
c.
The _xscale property is referring to the ball1 instance on the stage.
 

 64. 

An event handler is a ...
a.
bit of script that sits and waits on a special event to occur.
c.
bit of script that is called once when the instance leaves the stage.
b.
bit of script that is called once when the instance enters the stage
d.
all of the above
 

 65. 

Suppose you have instantiated a movie clip called ball on the stage.  With this clip being selected, you attach the following code to the instance....

onClipEvent(enterFrame){
       _xscale = xscale + 4;
}

This code will...                                     
a.
move the ball instance 4 pixels to the right along the x axis each frame by using the enterFrame event handler
c.
not work unless it is placed in the _root location of your movie
b.
make the ball instance 4 percent fatter each frame by using the enterFrame event handler
d.
none of the above.
 

 66. 

Attaching the following code to an instance of a movie clip will....

onClipEvent(load){
      _alpha = 50;
}
a.
reduce the saturation of the clip by 50 pixels
c.
reduce the saturation of the clip by 50 percent
b.
increase the saturation of the clip by 50 percent
d.
increase the saturation of the clip by 50 pixels
 

 67. 

The Output panel serves two important purposes.
a.
Reporting Syntax errors to the programmer and user messages to the user
c.
Reporting Syntax errors and graphical information to the programmer.
b.
Reporting Syntax errors and logical errors to the programmer
d.
Reporting Syntax errors and user mouse coordinates
 

 68. 

Consider the following code and that it is placed into the first frame of a movie...

trace(“hello!”);

The Output panel will show
a.
one instance of the word ‘hello!’
c.
this function is just declared and not called so there won’t be any output
b.
several instances of the word ‘hello!’
d.
It won’t show anything because “hello” was not declared as a variable.
 

 69. 

Operators are special symbols we can enter into a script that allow us to manipulate variables.  The variables they operate on are called...
a.
values
c.
logical operators
b.
operands
d.
event handlers
 

 70. 

Indicate below what is the correct compound statement.
a.
myNumber = myNumber + 100;
c.
myNumber += 100;
b.
myNumber + 100 = myNumber;
d.
none of the above
 

 71. 

Curly braces define what is commonly called...
a.
ActionScript
c.
code block
b.
C++
d.
script
 

 72. 

Indicate the best description for the following flow chart...

gameprogtest1_files/i0740000.jpg

a.
if Conditional
c.
else if Conditional
b.
else Conditional
d.
none of the above
 

 73. 

Indicate the best description for the following flow chart.

gameprogtest1_files/i0750000.jpg

a.
if Conditional
c.
else if Conditional
b.
else Conditional
d.
none of the above
 

 74. 

The following flow chart is a model for what type of Conditional

gameprogtest1_files/i0760000.jpg

a.
do while Conditional
c.
while Conditional
b.
nested Conditional
d.
for conditional
 

 75. 

In a do while loop....
a.
the code block is executed once before the condition is tested.
c.
if the evaluation is true then the code block is executed.
b.
the condition is tested first then the code block is executed.
d.
none of the above
 

Problem
 

 76. 

What is the value of life?

life = 100;
life = life - 11;
life++;
life = life +=60;
life = (life - 50);
 

 77. 

Consider the following statement...

Apples = peaches = pears = plums = oranges;

What are Apples?
 

 78. 

Consider the following...

myNumber = 10;
trace(++myNumber);
trace(myNumber++);
trace(myNumber);

What is the output for the trace function?
 

 79. 

Consider the following...

trace( 5 % 2);
trace( 10 % 2);
trace( 10 % 3);
trace( 1 % 5);
trace( 7 % 0);