Actionscript 3 MCQs

Actionscript 3 MCQs

Answer these 200+ Actionscript 3 MCQs and assess your grip on the subject of Actionscript 3.
Scroll below and get started!

1: What keyword brings control out of a loop?

A.   break

B.   stop

C.   split

D.   end

2: What will be in output console? var a: Sprite = new Sprite(); var b: Sprite = a; a = null; trace(b);

A.   nothing

B.   undefined

C.   null

D.   b

E.   [Object Sprite]

3: Which class can be used to read the URL that your SWF or media file is currently running on?

A.   Security

B.   Loader

C.   Stage

D.   LoaderInfo

4: What is the output of the following snippet? var animal1:String = "Lions"; var animal2:String = "Dogs"; var zoo:Array = new Array(animal1, animal2, " and Bears"); zoo[1] = "Tigers"; trace(zoo);

A.   Nothing; the function throws a compiler error

B.   Tigers,Dogs, and Bears

C.   Tigers,Lions, and Bears

D.   Lions,Tigers, and Bears

5: Which method will call the constructor of a parent class?

A.   branch()

B.   super()

C.   constructor()

D.   parent()

6: Which keyword allows a child class to overwrite a parent class's method?

A.   overwrite

B.   final

C.   override

D.   static

7: var check:Boolean = 0; will have value of?

A.   0

B.   false

C.   true

D.   1

E.   undefined

8: To detect when an object was entered to stage we listen for:

A.   ADD_STAGE

B.   ADDED

C.   ADDED_TO_STAGE

D.   ADDED_INTO_STAGE

9: How do you create a circle?

A.   obj.graphics.circle();

B.   obj.graphics.drawCircleObject();

C.   obj.graphics.drawCircle();

D.   obj.grafics.circle();

10: What is the import statement for Mouse Click events?

A.   flash.MouseEvent.MouseClick;

B.   flash.display.MovieClip.MouseEvent;

C.   flash.event.MouseClick;

D.   flash.display.MouseClick;

E.   flash.events.MouseEvent;

11: To display messages on the console we type:

A.   console.log('foo');

B.   console('foo');

C.   trace('foo');

D.   print('foo');

12: The correct syntax for opening a webpage using the default web browser is:

A.   open(new SiteRequest("www.web.site"));

B.   navigateToSite(new Site("www.web.site"));

C.   navigateToURL(new URL("www.web.site"));

D.   navigateToURL(new URLRequest("www.web.site"));

13: What is the output of the following snippet? var string1:String = "Hello World"; var string2:String = "Hello World"; if (string1 == string2) { trace("TRUE"); } else { trace("FALSE"); }

A.   Neither; the code prints out nothing

B.   Neither; the code results in a compile time error

C.   FALSE

D.   TRUE

14: What is the modular and performance-oriented concept upon which ActionScript is built?

A.   Functional Programming

B.   Object Oriented Programming

C.   Script Code Programming

D.   Procedural Programming

15: To bind an event listener the correct syxtax is:

A.   item.addEventListener('event',function);

B.   item.eventListener('event',function);

C.   item.addListener('event',function);

D.   item.listener('event',function);

16: Choose the BEST appropriate data type for the following situation: Lucy wants to store the names of the animals at the zoo into an array of variables.

A.   Char

B.   Int

C.   String

D.   Word

17: What is the correct function to call in order to open an external url?

A.   open(new SiteRequest("www.web.site"));

B.   navigateToSite(new Site("www.web.site"));

C.   navigateToURL(new URL("www.web.site"));

D.   navigateToURL(new URLRequest("www.web.site"));

18: Which of the following is a function of the MovieClip class?

A.   end()

B.   play()

C.   halt()

D.   gotoAndHalt()

19: What is a Sprite?

A.   A woodland fairy

B.   A data type similar to a String

C.   A bitmap image

D.   A display object container

20: What is the method to add a DisplayObject on the DisplayList ?

A.   addChild()

B.   load()

C.   addItem()

D.   push()

21: To disable mouse selection to an InteractiveObject, the correct syntax is:

A.   item.mouseEnabled = false;

B.   item.enabled(false)

C.   item.disableMouse()

D.   item.canClick = false;

22: Which one of the following is a strict type declaration?

A.   var myVar = new Sprite();

B.   var myVar:Sprite = new Sprite();

C.   var myVar:* = new Sprite();

D.   var myVar = Sprite();

23: Which of these is a valid variable declaration?

A.   var a:Number = 0;

B.   var int a = 0;

C.   a => 0

D.   variable a = 0;

24: What expression will insert a new line into a String?

A.   break

B.   \new

C.   newline

D.   \n

25: What element appears above and below lines of annotated code to distinguish them from working code?

A.   /< and >/

B.   */ and /*

C.   /* and */

D.   << and >>

26: Which function of the String class returns the number of characters in a string?

A.   characters()

B.   length()

C.   size()

D.   chars()

27: How do you end filling on a shape object?

A.   obj.gfx.endFill();

B.   obj.graphics.end();

C.   obj.grafics.endFill();

D.   obj.end();

E.   obj.graphics.endFill();

28: Which of the following is NOT a function of the String class?

A.   substring

B.   substr

C.   concat

D.   color

29: Which event class can be used to tell if a user clicks on an object?

A.   CursorEvent

B.   ClickEvent

C.   MouseEvent

D.   Event

30: Which statement can be used to exit an otherwise infinite for loop?

A.   break;

B.   exit;

C.   default;

D.   skip;

31: ButtonOne.addEventListener(MouseEvent.CLICK,runA); ButtonTwo.addEventListener(MouseEvent.CLICK,runB); What happens when ButtonOne's click event is triggered?

A.   runB is called

B.   Neither runA nor runB are called

C.   Both runA and runB are called

D.   runA is called

32: The addEventListener() function is used to ________.

A.   Remove an event

B.   Add an event

C.   Register an event listener for an event

D.   Hide an event listener

33: What is the difference between .swc and .swf?

A.   .swf is more lightweight

B.   none

C.   .swc can be imported as a standalone library

D.   .swc is for graphics

34: What is the smallest amount by which the Timer class measures time?

A.   Seconds

B.   Milliseconds

C.   Nanoseconds

D.   Frames

35: How do you add an object to the display list?

A.   addChild(object);

B.   addToStage(object);

C.   addToDisplay(object);

D.   add(object);

36: The correct syntax for removing an object from a specific index position of the stage is:

A.   stage.remove(index);

B.   stage.removeChildIndex(index);

C.   stage.removeChild(index);

D.   stage.removeChildAt(index);

37: Which class can be used to change the color of a display object?

A.   ObjectFormat

B.   Matrix

C.   Transform

D.   ColorTransform

38: What symbols represent an XML literal tag delimiter?

A.   ( )

B.   < >

C.   [ ]

D.   { }

39: Choose the BEST appropriate data type for the following situation: A teacher would like you to record a list of student names and grades in an array.

A.   int

B.   String

C.   Char

D.   uint

40: public function someFunction(value: Number) { switch(value) { case 5: trace ("Hello"); case 9: trace ("World"); } trace("Apples"); } What would the output be if someFunction(4) were called?

A.   Hello World Apples

B.   Nothing; the function would throw a compiler error

C.   HelloWorldApples

D.   Apples

41: How would you load an image from an external file?

A.   var loader = new URL("file location");

B.   var ldr = new loader("file location");

C.   var URLRequest = ("file location");

D.   var urlReq:URLRequest = new URLRequest("file location");

E.   url = new URL("file location");

42: Which class can be used to find the size in bytes of your SWF or other media file?

A.   Loader

B.   FileData

C.   FileSize

D.   LoaderInfo

43: On an Event handler function, how do you know which item fired the event ?

A.   It is impossible

B.   By accessing the parent property of the event

C.   By accessing the target property of the event

44: To communicate with Javascript the correct synxtax is:

A.   ExternalInterface.call('foo');

B.   ExternalInterface('foo');

C.   External.call('foo');

D.   Interface.call('foo');

45: What event is dispatched when a Loader finishes loading?

A.   Event.LOADING_COMPLETE

B.   Event.COMPLETE_REQUEST

C.   Event.COMPLETE

D.   Event.REQUEST_COMPLETE

46: The function Date.getDay() will return a zero for what day of the week?

A.   Saturday

B.   Monday

C.   Sunday

D.   Wednesday

47: Sprite is a class of the following package:

A.   flash.display.graphics

B.   flash.graphics

C.   flash.display

D.   flash.displaycore

48: The proper syntax for assigning an object literal is:

A.   var obj:{"foo", "bar"}

B.   var obj:{prop1:"foo", prop2:"bar"}

C.   var obj:Object = {"foo", "bar"}

D.   var obj:Object = {prop1:"foo", prop2:"bar"}

49: Referring to the index position of an array item that doesn't exist will throw which error?

A.   EvalError

B.   RangeError

C.   DefinitionError

D.   SizeError

50: What does the stop() action do?

A.   It stops playback in the _root timeline

B.   The code progress stops until play() is called

C.   Flash doc pauses until the user presses “return”

D.   It stops playback in the timeline it is called in