UpWork (oDesk) & Elance Action Script 3.0 Test Question & Answers

13:15
UpWork (oDesk) & Elance Action Script 3.0 Test Question & Answers are really very important to pass UpWork & Elance test. You will get top score at this skill test exam. If you found any problem or wrong answer please inform me via contact or comments. We will try to solve it in short. This test is extremely valuable to acquire knowledge of this skill. Lets Start test.


Ques : Which of the following methods of the XML object class can be used to add a new node to an XML object?
Ans  : appendNode()
       appendChild()
       prependChild()
 
Ques : When a variable is of the type protected, it is accessible in:
Ans  : all child classes irrespective of the package

Ques : Which of the following statements is correct?
Ans  :  The '.' and '@' operator can be used both to read and write data

Ques : What will be the output of the following code snippet?
    var myArray1 : Array = new Array ("One", "Two", "Three");
    for(var i : int=0; i<3 i="" p="">    {
        delete myArray1[i];
    }
    trace(myArray1.length);
Ans  : 0

Ques : Which of the following statement is not correct?
Ans  : While accessing child nodes of an XMLList, the array access operator '[]' can be used and the starting Index is 0.

Ques : What will be the output of the following code snippet?

    var myArray1 : Array = new Array("One", "Two", "Three");
    var myArray2 : Array = myArray1;
    myArray2[1] = "Four";
    trace(myArray1);
Ans  : One,Four,Three

Ques : Which of the following property of the String class returns the no. of characters in a string?
Ans  : length

Ques : Which of the following statements is true?
Ans  : An array is a collection of objects irrespective of the data types.

Ques : What would happen when the following piece of code is compiled and run?
var p : * = new ArrayCollection()      //Line1
p.addItem("vishal");                     //Line2
p.addItem(24);                        //Line3
p= new Date();                        //Line4
var mydate : Date = p;                  //Line5
Ans  : Compilation error at line4

Ques : Which of these is not a valid access modifier?
Ans  : All of the above are valid.

Ques : When ActionScript can immediately judge an operation to be in violation of a security rule, the __________ exception is thrown, and if, after waiting for some asynchronous task to complete, ActionScript deems an operation in violation of a security rule, the __________ event is dispatched.
Ans  : SecurityError, SecurityErrorEvent.SECURITY_ERROR

Ques : Which of the following is not a phase in the event propagation lifecycle?
Ans  : Cancelling

Ques : What will be the output of the following code snippet?

try {
    try {
        trace("<< try >>");
        throw new ArgumentError ("throw this error");
    } catch(error : ArgumentError) {
        trace("<< catch >> " + error);
        trace("<< throw >>");
        throw error;
    } catch(error:Error) {
        trace ("<< Error >> " + error);
    }
} catch (error:ArgumentError) {
    trace ("<< catch >> " + error);
}
Ans  :  << try >> << catch >> ArgumentError: throw this error << throw >> << catch >> ArgumentError: throw this error

Ques : What will be the output of the following trace statement?

trace ("output: " + 10 > 20);
Ans  : false

Ques : In the date formatter's format string, which of the following pattern letter represents minutes?
Ans  : M

Ques : Which event is triggered when a timer completes its execution?
Ans  : TimerEvent.TIMER_COMPLETE

Ques : Given the following string variable declaration, where 3 is an int

var myString : String = "These are " + 3 + " lines"

The value stored in myString is:
Ans  : These are 3 lines

Ques : The trim() method of StringUtil Class is used:
Ans  :  to remove all white spaces from the beginning and the end of the string

Ques : Given the following code snippet, what will be the output when helloWorld() is run?

public function helloWorld() : void {
    trace("Line 1" );
    var num : Number=25;
    try{
        num=num/0;
        trace ("Value of num in try: "+num.toString());
    }catch (err : IOError) {
        trace("Value of num in catch: "+num.toString());
    }finally{
        num=0;
    }
    trace("Value of num: "+num.toString());
}
Ans  :  Line1 Value of num in catch: 25 Value of num: 0

Ques :  Which of the following are primitive datatypes in Action script 3.0:
Ans  :  String

Ques : What will be the output of the following code snippet?

        var num1 : String="Hello";
        var num2:String="Hello";
        if (num1===num2) {
                trace ("Equal");
        } else {
                trace ("Unequal");
        }
Ans  : Equal

Ques : Which property of the Event object contains information about the component which generated that event?
Ans  : target

Ques : What will the output of the following trace statement?

trace(myXML..employee.(lastName=="Zmed"));
Ans  : The first employee block is printed on the console.

Ques : Given that two event listeners are registered for a component CompA as:

CompA.addEventListener(MouseEvent.CLICK, func1);
CompA.addEventListener(MouseEvent.CLICK, func2);

What will happen when a click event is fired on CompA?
Ans  : Both func1 and func2 are called.

Ques : When in application, in what order do the following events take place (starting from the first)?
Ans  :  pre-Initialize, Initialize, Creation complete, Application complete

Ques : What does the addItem() method of the ArrayCollection class do?
Ans  :  It adds an item at the end of the collection.

Ques : Given the code snippet below, what will be the value of myFlag after the 2nd assignment:
var myFlag : Boolean=false;
myFlag=Boolean (new Date ( ) );
Ans  : True

Ques : Which of the following is not a valid Action script data type?
Ans  : long

Ques : The only difference between a timer and a loop is that timers are machine speed independent while loops are not.
Ans  : False

Ques : Look at the following function declarations and then choose the correct option.

i. public function myFunction():*;
ii. public function myFunction():void;
iii. public function myFunction():String;
Ans  : i, ii & iii are all valid

Ques : Given the following instantiation of a date type variable, choose the statement which is true.

var myDate : Date = new Date()
Ans  : The value of myDate is the current time stamp.

Ques : Which of the following Errors does not occur at runtime?
Ans  : Compile time error

Ques : The useWeakReference parameter in the addEventListener method is used to:
Ans  :  make the listener eligible for garbage collection

Ques : Given the following statements about the try/catch/finally block, choose the correct option.
Ans  : Finally is optional but try and catch are required.

Ques : Based on the above mentioned declaration of myXML, how can we access the id attribute of the 'employee' tag?
Ans  : myXML.managers.employee[1].@id

Ques : Which of the following methods of the String class does not accept a regular expression as its parameter?
Ans  : substring()

Ques : Given the following code snippet:

public function helloWorld(value:int) : String {
switch(value){
  case 1:
    return "One";
    break;
  case 2:
    return "Two";
    break;
  case 3:
    return "Three";
    break;
  default:
    return "No Match";
  }
}

What will be returned if we pass call the above function as helloWorld(2):
Ans  : Two

Ques : A constant (const) variable can be initiated only once.
Ans  : True

Ques : Which of the following classes is not used to interact with the client system environment?
Ans  : ApplicationDomain Class

Ques : The minimum version of flash player required to run Action script 3.0 is:
Ans  : 9.0

Ques : Which of the following syntax would be used to call a method name helloWorld(), (defined in the html Wrapper) from actionscript?
Ans  : ExternalApplication.call ("helloWorld");

Ques : Given the declaration 'a timer', which of the following statements is correct?

var myTimer:Timer = new Timer (500,5);
Ans  :  When the timer is started, the TimerEvent.TIMER event is dispatched 5 times with a difference of 0.5 seconds between 2 successive events.

Ques : Which of the following conditions must be true to facilitate the usage of seek() function of an Array Collection's Cursor?
Ans  : None of the above

Ques : The following regular expression : var pattern : RegExp = /\d+/; will match:
Ans  : one or more digits

Ques : What does XML stand for?
Ans  : Extensible Markup Language

Ques : A String is:
Ans  : a series of zero or more characters.

Ques : Given the following code snippet:
public class Student {
    public function Student () {
        trace("Student variable created");
    }
    public function hello () : String {
        return "Hello World";
    }
}
-------------------------------------------------------
public function helloWorld () : String {
    var student1 : Student;
    return student1.hello ();
}

What will the function helloWorld() return?
Ans  : Hello World

Ques :  Which of the following types of variables can be accessed without creating an instance of a class?
Ans  : Static

Ques : E4X in Action script is used to:
Ans  :  manipulate XML data.

Ques : What will be the output of the following trace statement?

trace(myXML..employee.*.@*);
Ans  : An XMLList that includes every attribute defined on the employee tag's descendants but not on the employee tag

Ques : The default values of String and int type variables are:
Ans  : null and 0 respectively.

Ques : Which of the following statements is not correct?
Ans  :  When a timer is instantiated, it starts automatically.

Ques : While accessing the clipboard through the system manager class, we can:
Ans  : read data from the clipboard.

Ques : Given two String variables str1="Hello" and str2="World", which of the following 2 ways can be used to concatenate the 2 strings and store the result in str1?
Ans  : str1.concat(str2);

Ques : Which of the following loop structures are used to access dynamic instance variables of an object?
Ans  : for-each-in

Ques : Which of the following properties of the Date class does not accepts 0 as a value?
Ans  : date

Ques : Which class is the parent class of all custom event classes?
Ans  : Event

Ques : Suppose we have two swf's named Parent.swf and Child.swf (in the same domain), where the Child.swf is loaded inside the Parent.swf as a module, can an Event listener be registered in the Parent.swf to detect mouse click events inside the Child.swf?
Ans  : Yes, for any event

Ques :  Read the following statements and then choose the correct option.
i. A class can extend another class
ii. A class can Implement an Interface
iii. An interface can extend a class
iv. An interface can extend another interface
Ans  : Only i, ii and iv are true

Ques : Which of the following statements about the System class is true?
Ans  : It can be used to retrieve current memory usage for flash player.

Ques : The Error class serves as the base class for all run-time errors thrown by Flash.
Ans  : True

Ques : Which of the following keywords is used to bring control out of a loop?
Ans  : break

Ques : The addEventListener() method of the EventDispatcher class is used to:
Ans  : add/register a new listener for an event

Ques : Which of the following is not a security-sandbox type?
Ans  :  Remote-with-networking

Ques : If no Access modifier is specified for a property in a class, then by default, the property is:
Ans  : Private

Ques : What is the length of the given array?

var myArray1 : Array = new Array ("One", "Two", "Three");
Ans  : 3

Ques : Suppose we have an arrayCollection whose cursor (myCursor) has been created using the arraycollection's getCursor() method. At runtime, when myCursor.afterLast returns true, what is the value of myCursor.current?
Ans  : Null

Ques : Given a number, num = 23, which of the following methods will be used to convert it to a String:
Ans  : num.toString();

Ques : Which of the following is not a valid quantifier metacharacter used in Regular expressions?
Ans  : -

Ques : The compiled output of an Action script file is:
Ans  : '.swf' file

Ques : Given the following code snippet, what will be the output when helloWorld( ) is run?

public function helloWorld() : void {
    trace("Code Start" );
    try{
        throw new Error ("Test_Error");
        trace("try");
    } catch(err : Error) {
        trace("catch");
        return;
    }finally{
        trace("finally");
    }
    trace("Code End");
}
Ans  : Code Start catch finally

Ques : Which of the following is a valid variable name?
Ans  : _123

Ques : An Swf in a local security sandbox:
Ans  : can access some but not all resources in the local security sandbox.

Ques : Which kind of an error is thrown when parsing error occurs in the action script?
Ans  : Syntax error

Ques : The source of an ArrayCollection is of the type:
Ans  : Array

Ques : Which of the following is not a correct way of adding an item to an Array myArr?
Ans  : myArr.addItem(item);

Ques : Which nature of ActionScript is depicted by the use of Events?
Ans  : Asynchronous

Thanks for watching this test Question & Answers. Please don't forget to leave a comment about this post. You can also find some more effective test question & answers, information, techniques, technology news, tutorials, online earning information, recent news, results, job news, job exam results, admission details & another related services on the following sites below. Happy Working!
News For Todays ARSBD UpWorkElanceTests ARSBD-JOBS DesignerTab

Share this

Related Posts

Previous
Next Post »

We recommend you to subscribe us to get update from your email. EmoticonEmoticon