Question:* Which statement can be used to exit an otherwise infinite for loop?
Answer: • break;
Question:* Read the following code: var str1:String = "foobar"; var str2:String = "helloWorld"; var str3:String = (str1.length > 5) ? str1 : str2; trace(str3); What will be the output?
Answer: • foobar
Question:* 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.
Answer: • String
Question:* Sprite is a class of the following package:
Answer: • flash.display
Question:* Which keyword allows a child class to overwrite a parent class's method?
Answer: • override
Question:* How do you create a circle?
Answer: • obj.graphics.drawCircle();
Question:* What is the import statement for Mouse Click events?
Answer: • flash.events.MouseEvent;
Question:* To disable mouse selection to an InteractiveObject, the correct syntax is:
Answer: • item.mouseEnabled = false;
Question:* How do you end filling on a shape object?
Answer: • obj.graphics.endFill();
Question:* ButtonOne.addEventListener(MouseEvent.CLICK,runA); ButtonTwo.addEventListener(MouseEvent.CLICK,runB); What happens when ButtonOne's click event is triggered?
Answer: • runA is called
Question:* Which event class can be used to tell if a user clicks on an object?
Answer: • MouseEvent
Question:* Which function of the String class returns the number of characters in a string?
Answer: • length()
Question:* Which of the following is NOT a function of the String class?
Answer: • color
Question:* What is a Sprite?
Answer: • A display object container
Question:* What element appears above and below lines of annotated code to distinguish them from working code?
Answer: • /* and */
Question:* 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.
Answer: • String
Question:* Which one of the following is a strict type declaration?
Answer: • var myVar:Sprite = new Sprite();
Question:* Which of the following is a function of the MovieClip class?
Answer: • play()
Question:* To display messages on the console we type:
Answer: • trace('foo');
Question:* What expression will insert a new line into a String?
Answer: • \n
Question:* What is the modular and performance-oriented concept upon which ActionScript is built?
Answer: • Object Oriented Programming
Question:* What is the method to add a DisplayObject on the DisplayList ?
Answer: • addChild()
Question:* 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"); }
Answer: • TRUE
Question:* To bind an event listener the correct syxtax is:
Answer: • item.addEventListener('event',function);
Question:* What is the correct function to call in order to open an external url?
Answer: • navigateToURL(new URLRequest("www.web.site"));
Question:* The correct syntax for opening a webpage using the default web browser is:
Answer: • navigateToURL(new URLRequest("www.web.site"));
Question:* The addEventListener() function is used to ________.
Answer: • Register an event listener for an event
Question:* Which class can be used to change the color of a display object?
Answer: • ColorTransform
Question:* Which of these is a valid variable declaration?
Answer: • var a:Number = 0;
Question:* What is the smallest amount by which the Timer class measures time?
Answer: • Milliseconds
Question:* How do you add an object to the display list?
Answer: • addChild(object);
Question:* The correct syntax for removing an object from a specific index position of the stage is:
Answer: • stage.removeChildAt(index);
Question:* What keyword brings control out of a loop?
Answer: • break
Question:* Which of these is a valid variable declaration?
Answer: • All of them.
Question:* var check:Boolean = 0; will have value of?
Answer: • false
Question:* What is the difference between .swc and .swf?
Answer: • .swc can be imported as a standalone library
Question:* To detect when an object was entered to stage we listen for:
Answer: • ADDED_TO_STAGE
Question:* 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?
Answer: • Apples
Question:* Which method will call the constructor of a parent class?
Answer: • super()
Question:* The proper syntax for assigning an object literal is:
Answer: • var obj:Object = {prop1:"foo", prop2:"bar"}
Question:* The function Date.getDay() will return a zero for what day of the week?
Answer: • Sunday
Question:* What event is dispatched when a Loader finishes loading?
Answer: • Event.COMPLETE
Question:* To communicate with Javascript the correct synxtax is:
Answer: • ExternalInterface.call('foo');
Question:* How would you load an image from an external file?
Answer: • var urlReq:URLRequest = new URLRequest("file location");
Question:* On an Event handler function, how do you know which item fired the event ?
Answer: • By accessing the target property of the event
Question:* Which class can be used to find the size in bytes of your SWF or other media file?
Answer: • LoaderInfo
Question:* What symbols represent an XML literal tag delimiter?
Answer: • < >
Question:* What is the result of the following code? var b:Array = [1,2,3].map(function(i) { return i+1 }); trace(b);
Answer: • 2,3,4
Question:* What is the name of the function of the StringUtil Class that removes all white spaces from the beginning and end of a String?
Answer: • trim()
Question:* Which is NOT a valid access modifier?
Answer: • These are all valid access modifiers
Question:* Referring to the index position of an array item that doesn't exist will throw which error?
Answer: • RangeError
Question:* Which class is used to load an XML File?
Answer: • URLLoader
Question:* What does the stop() action do?
Answer: • It stops playback in the timeline it is called in
Question:* Choose the BEST appropriate data type for the following situation: Your boss wants you to calculate the percentage of people that donated more than five dollars to your non-profit.
Answer: • Number
Question:* What class is needed to change the alignment of text in a TextField?
Answer: • TextFormat
Question:* 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);
Answer: • Lions,Tigers, and Bears
Question:* What is a correct syntax to cast a String "str" into a Number?
Answer: • newNum = Number(str);
Question:* Which is required to download images from another domain?
Answer: • crossdomain policy file
Question:* Which method allows you to join two Arrays into a new Array?
Answer: • var myNewArray:Array = myArray1.concat(myArray2);
Question:* Which of the following is an example of a bitwise operator
Answer: • >>
Question:* Which of the following is not a primitive type in ActionScript 3.0?
Answer: • Array
Question:* Sprite is a class of the following package:
Answer: • flash.display
Question:* To detect when an object has entered into a stage we listen for:
Answer: • obj1.addEventListener(Event.ADDED_TO_STAGE,fn);
Question:* When using addChild() to add a child object, what does the "child" get added to?
Answer: • The Display List
Question:* How can you retrieve an attribute from an XML variable?
Answer: • myXML.item.@source;
Question:* The correct syntax for testing for overlap between the bounding boxes of two objects is:
Answer: • obj1.hitTestObject(obj2);
Question:* What object can't be added to display list directly?
Answer: • BitmapData
Question:* Which of these errors does not occur at runtime?
Answer: • Compile time error
Question:* In the event of an infinite recursion, what exception will be thrown?
Answer: • StackOverflowError
Question:* Which class can be used to read the URL that your SWF or media file is currently running on?
Answer: • LoaderInfo
Question:* How do you properly remove c in: var c:MovieClip = new MovieClip(); c.addEventListener(Event.ENTER_FRAME, myFunction); addChild(c);
Answer: • c.removeEventListener(Event.ENTER_FRAME, myFunction); removeChild(c);
Question:* To skip the remaining code in a loop and proceed to the next cycle without leaving the loop you would type
Answer: • continue;
Question:* What is the difference between .swc and .swf?
Answer: • .swc is a class packet, .swf is an executable
Question:* If a Timer is set with a repeatCount of 0 (zero), how many times will the timer run?
Answer: • Infinitely many
Question:* What is the default maximum size allocated by the user for shared objects?
Answer: • 100 KB
Question:* Which property of an event listener can be set to allow for garbage collection of that listener?
Answer: • useWeakReference
Question:* What access modifier hides a variable or function?
Answer: • private
Question:* To successfully remove an event listener the correct syntax is:
Answer: • this.removeEventListener('event',function);
Question:* What is an appropriate class to utilize when importing data from an external file?
Answer: • URLLoader
Question:* What type of number is returned by Math.asin()?
Answer: • Radian
Question:* To dispatch an event with a custom type the correct syntax is:
Answer: • this.dispatchEvent(new Event('myEvent'));
Question:* ActionScript 3.0 is related most closely to ________.
Answer: • JavaScript
Question:* What is the name of the variable that passes arguments into a flash movie (.swf)?
Answer: • FlashVars
Question:* Which video format is AIR and Flash Player NOT compatible with?
Answer: • OGG
Question:* How do you access a specific child of a container Sprite?
Answer: • mySprite.getChildByName('child');
Question:* What method is used to find the character at position (i) in a String (s)?
Answer: • s.charAt(i)
Question:* What is the default maximum size for a remote shared object?
Answer: • 100 kB
Question:* When started, how will the following Timer execute? var timer:Timer = new Timer(3000,0); will run for:
Answer: • 3000ms - Infinite
Question:* Read the following code: var i:int = 5; var s:String = "5"; trace(i==s); trace(i===s); What will this code output?
Answer: • true, false
Question:* Read the following code: var bool1:Boolean = true; var bool2:Boolean = false; trace(bool1 ||= bool2); trace(bool1 &&= bool2); What will be the output?
Answer: • true, false
Question:* Which of the following ways can be used to concatenate String str1 and String str2? 1). str1 = str1 + str2; 2). str1.concat(str2); 3). str1.concat(str1, str2); 4). str1 += str2;
Answer: • 1, 2, and 4
Question:* Which of the following text controls allows the user to input text? i. Text ii. TextArea iii. TextInput iv. RichTextEditor
Answer: • ii, iii, and iv
Question:* How do you store data in a Dictionary?
Answer: • dictionary[key] = 'key';
Question:* What is the output of the following snippet? var world:Number = 3; trace("Hello " + world + 3 + "3");
Answer: • Hello 333
Question:* Which of the following is a valid way to create a Vector of type String? i. var v: Vector.<String> = new <String>["str1", "str2", "str3"]; ii. var v:Vector.<String> = new Vector.<String>(); iii. var v:<String>Vector = new <String>Vector(); iv. var v: <String>Vector = ["str1", "str2", "str3"];
Answer: • i and ii
Question:* The volume of a sound can be adjusted using what class?
Answer: • SoundTransform
Question:* Which keyword will prevent a method from being overwritten by a child class?
Answer: • final
Question:* What will be in output console? var a: Sprite = new Sprite(); var b: Sprite = a; a = null; trace(b);
Answer: • [object Sprite]
Question:* What property of an event listener refers to the object actively processing an Event object?
Answer: • currentTarget
Question:* What are the three phases of the event flow?
Answer: • capture, target and bubbling
Question:* What does the following display? for each (var someVar in someArray) { trace(someVar); }
Answer: • The contents of the array someArray
Question:* To cast a class as a specific type the correct syntax is:
Answer: • type:myType = new Type() as myType;
Question:* What is AVM1Movie ?
Answer: • AVM1Movie is a class that represents AVM1 movie clips, which use ActionScript 1.0 or 2.0.
Question:* To display hand cursor over a Sprite you declare:
Answer: • useHandCursor = true;
Question:* Which of the following will NOT be garbage collected?
Answer: • sprite.addEventListener(MouseEvent.Click,myFn);
Question:* Which of the following is a function of the Timer class?
Answer: • reset()
Question:* Which one is a valid method of opening a link in ActionScript 3?
Answer: • navigateToURL(new URLRequest("http://google.com"), "_blank");
Question:* What will be in output console? var a: Sprite = new Sprite(); var b: Sprite = a; a = null; trace(b);
Answer: • [Object Sprite]
Question:* What property of the Date class does not accept 0 as a parameter?
Answer: • date
Question:* Which of these functions of ArrayCollection adds an item at the end of a collection?
Answer: • addItem()
Question:* Which of the following will add the element someElement to the end of the Array someArray?
Answer: • someArray[someArray.length] = someElement;
Question:* What is the result of the following code: import flash.utils.getDefinitionByName; var ClassReference:Class = getDefinitionByName("flash.display.Sprite") as Class; var instance:Object = new ClassReference(); trace(instance);
Answer: • [object Sprite]
Question:* What class creates a two way connection between a client Flash/AIR application and a server?
Answer: • NetConnection
Question:* Which of the following snippets will set String myDay to the current day of the week?
Answer: • var d:Date = new Date(); myDay = d.day;
Question:* How do you create style rules for textFields?
Answer: • txt.setTextFormat(options);
Question:* The following code will create: box.graphics.beginFill(0xffffff,0);
Answer: • Nothing
Question:* What is the difference between Shape and Sprite?
Answer: • Shape cannot add children to it self.
Question:* Which of these is not a valid class?
Answer: • Integer
Question:* Which class of objects can be focused by setting stage.focus?
Answer: • InteractiveObject
Question:* To bind a Class to a bitmap object you do the following:
Answer: • bitmap = new myClass();
Question:* What effect does the following code have? button.useHandCursor = true; button.buttonMode = true; button.mouseChildren = false;
Answer: • Pointer Mouse cursor
Question:* Read the following code: var str1:String = "Hello world!"; trace(str1.substr(2,7)); What will be the output?
Answer: • llo wor
Question:* How to change the text color of a TextField?
Answer: • field.textColor = 0x000000;
Question:* MovieClip is a direct child of which class?
Answer: • Sprite
Question:* To hide the standard context menu options, which function can you call?
Answer: • hideBuiltInItems()
Question:* Which of the following is NOT a property of a GeolocationEvent?
Answer: • timezone
Question:* Which is not a correct StageScaleMode Constant?
Answer: • StageScaleMode.STRETCH;
Question:* To make a Sprite have hand cursor when hovered you do the following:
Answer: • All of these
Question:* Which event fires when the display objects of a frame have loaded but before any frame scripts run?
Answer: • frameConstructed
Question:* What is the result of the following code: var b:Number = ["0","1","2","3","4"].indexOf(0); trace(b)
Answer: • -1
Question:* Tween easing is loaded by importing:
Answer: • fl.transitions.easing
Question:* What is an appropriate class to utilize when storing data to an external file?
Answer: • There is no such class
Question:* What is the output of the following snippet? var s:String = "Pandas use tea cups to drink tea"; s.replace("tea", "");
Answer: • Pandas use tea cups to drink tea
Question:* Which of the following can you NOT do through the System class?
Answer: • Read the user's clipboard
Question:* The Loader object exists in which package?
Answer: • flash.display
Question:* Which is true about Stage?
Answer: • Stage can be scaled.
Question:* What is the default access modifier if none is specified?
Answer: • internal
Question:* Which of these is a valid variable declaration?
Answer: • var a:Number = 0;
Question:* What expression will insert a new line into a String?
Answer: • \n
Question:* What is the difference between .swc and .swf?
Answer: • .swc can be imported as a standalone library
Question:* Which of these is a valid variable declaration?
Answer: • All of them.
Question:* Sprite is a class of the following package:
Answer: • flash.display
Question:* What is the difference between .swc and .swf?
Answer: • .swc is a class packet, .swf is an executable
Question:* What will be in output console? var a: Sprite = new Sprite(); var b: Sprite = a; a = null; trace(b);
Answer: • [object Sprite]
Question:* What will be in output console? var a: Sprite = new Sprite(); var b: Sprite = a; a = null; trace(b);
Answer: • [Object Sprite]
No comments:
Post a Comment