Action Script 3.0 Test
The
following regular expression : var pattern : RegExp = /\d+/; will match:
a. one
or more words
b. zero
or more words
c.
one or more digits
d. zero
or more digits
This
question is based upon the figure shown below
What
will be the output of the following trace statement?
trace(myXML..employee.*.@*);
a. An
XMLList that includes every attribute defined on the employee tag, its parent
and all descendants
b. An
XMLList that includes every attribute defined on the employee's parent tag and
all descendant tags
c.
An XMLList that includes every attribute defined on the employee tag's
descendants but not on the employee tag
d. An
XMLList that includes every attribute defined on the employee tag and all its
descendants
Which
of the following keywords is used to bring control out of a loop?
a.
break
b.
continue
c. end
d.
terminate
When
a variable is of the type protected, it is accessible in:
a.
all child classes irrespective of the package
b. only
child classes in the same package
c. only
child classes outside the current package
d. not
accessible in any of the child classes.
Which
of the following statements is correct?
a. The
'.' and '@' operator can be used only to read data.
b. The
'.' operator can be used to read data and write data but the '@' operator can
be used only to read data.
c.
The '.' and '@' operator can be used both to read and write data.
d. The
'@' operator can be used to read data and write data but the '.' operator can
be used only to read data.
Which
of the following property of the String class returns the no. of characters in
a string?
a. size
b.
numChar
c.
length
d. None
of the above
This
question is based upon the figure shown below
What
will the output of the following trace statement?
trace(myXML..employee.(lastName=="Zmed"));
a. All
employee blocks are printed on the console.
b.
The first employee block is printed on the console.
c. The
complete structure of myXML is printed in the console.
d. Only
the lastName tag with value "Zmed" is printed.
Which
nature of ActionScript is depicted by the use of Events?
a.
Synchronous
b.
Asynchronous
c.
Procedure oriented
d.
Object oriented
What
will be the output of the following trace statement?
trace
("output: " + 10 > 20);
a.
output: true
b.
output: false
c. true
d.
false
The
default values of String and int type variables are:
a.
null and 0 respectively.
b.
"" and NaN respectively.
c. null
and Nan respectively.
d.
"" and 0 respectively.
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.
a.
Security, SecurityErrorEvent.SECURITY_ERROR
b.
SecurityError, SecurityErrorEvent.ERROR
c.
SecurityError, SecurityErrorEvent.SECURITY_ERROR
d.
Security, SecurityErrorEvent.ERROR
Which
of these is not a valid access modifier?
a.
Private
b.
Protected
c.
Internal
d.
All of the above are valid.
An
Swf in a local security sandbox:
a. can
access all resources in the local security sandbox.
b.
can access some but not all resources in the local security sandbox.
c. can
access no resources in the local security sandbox.
d. can
access resources in the local as well as the remote security sandbox.
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);
}
a.
<< try >> << catch >> ArgumentError: throw this error
<< throw >> << Error >> ArgumentError: throw this error
<< catch >> ArgumentError: throw this error
b.
<< try >> << catch >> ArgumentError: throw this error
<< throw >>
c.
<< try >> << catch >> ArgumentError: throw this error
<< throw >> << catch >> ArgumentError: throw this error
d.
Compilation error: Nesting or try catch block not permitted
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());
}
a.
Line1
Value of num in try: 25
Value of num in catch: 25
Value of num: 0
b.
Line1
Value of num in catch: 25
Value of num: 0
c.
Line1
Value of num in try: 25
Value of num in catch: 25
d. Line
1
Value of num in try: Infinity
Value of num: 0
Which
of the following is not a valid Action script data type?
a. int
b. uint
c.
long
d.
String
The
source of an ArrayCollection is of the type:
a.
ArrayCollection
b. int
c.
String
d.
Array
When
in application, in what order do the following events take place (starting from
the first)?
a.
Creation complete, pre-Initialize, Initialize, Application complete
b.
pre-Initialize, Creation complete, Initialize, Application complete
c.
pre-Initialize, Initialize, Application complete, Creation complete
d.
pre-Initialize, Initialize, Creation complete, Application complete
Which
of the following is a valid variable name?
a.
_123
b. 123
c.
my@Var
d.
my-Var
Which
property of the Event object contains information about the component which
generated that event?
a.
target
b.
currentTarget
c. type
d.
eventPhase
Which
of the following classes is not used to interact with the client system
environment?
a.
Application Class
b.
ApplicationDomain Class
c.
System Class
d.
Capabilities Class
The
trim() method of StringUtil Class is used:
a. only
to remove all white spaces from the beginning of the string.
b. only
to remove all white spaces from the end of the string.
c.
to remove all white spaces from the beginning and the end of the string.
d. to
remove all whitespaces in the string including those inside the string.
What
is the length of the given array?
var
myArray1 : Array = new Array ("One", "Two",
"Three");
a. 0
b. 1
c. 2
d. 3
Which
of the following is not a phase in the event propagation lifecycle?
a.
Targeting
b.
Bubbling
c.
Cancelling
d.
Capturing
Which
class is the parent class of all custom event classes?
a.
Event
b.
MouseEvent
c.
ResultEvent
d.
EventDispatcher
Which
of the following is not a security-sandbox type?
a.
Local-trusted
b.
Local-with-networking
c.
Remote
d.
Remote-with-networking
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");
}
a.
Equal
b.
Unequal
c.
""
d.
Compilation error: Syntax error
Which
of the following syntax would be used to call a method name helloWorld(),
(defined in the html Wrapper) from actionscript?
a.
Application.call ("helloWorld");
b.
ExternalApplication.call ("helloWorld");
c.
ExternalInterface.call ("helloWorld");
d.
helloWorld ();
Given
the code snippet below, what will be the value of myFlag after the 2nd
assignment:
var
myFlag : Boolean=false;
myFlag=Boolean
(new Date ( ) );
a.
True
b.
False
c. Run
time error
d. Type
Coercion error at compile time
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;
a. only
i & ii are valid
b. only
ii & iii are valid
c. only
i & iii are valid
d.
i, ii & iii are all valid
The
addEventListener() method of the EventDispatcher class is used to:
a.
create a new Event
b.
delete an event
c.
add/register a new listener for an event
d.
deregister an event listener
This
question is based upon the figure shown below
Based on the above mentioned declaration of
myXML, how can we access the id attribute of the 'employee' tag?
a.
myXML.managers.employee[1].@id
b.
myXML.employeeList.managers.employee[1].@id
c.
myXML.managers.employee[1].id
d.
myXML.employeeList.managers.employee[1].id
A
String is:
a. a
series of zero or more characters.
b. a
series of one or more characters.
c. a
single character.
d. a
set of no more than 5 characters.
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?
a.
func1 is called but func2 is not called.
b.
func2 is called but func1 is not called.
c.
Either func1 or func2 are randomly chosen and called.
d.
Both func1 and func2 are called.
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
a. Only
i and ii are true
b. Only
i, ii and iii are true
c.
Only i, ii and iv are true
d. All
the four are true
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
a.
Compilation error at line1
b.
Compilation error at line4
c.
Compilation error at line5
d. No
error. The code will compile and run without errors.
Which
of the following is not a correct way of adding an item to an Array myArr?
a.
myArr.push(item);
b.
myArr.addItem(item);
c.
myArr[0] = item;
d. All
of the above
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);
a.
One,Two,Three
b.
Four,Two,Three
c.
One,Four,Three
d.
Two,Three,Four
The
compiled output of an Action script file is:
a.
'.class' file
b.
'.swf' file
c.
'.as' file
d.
'.mxml' file
Which
of the following statement is not correct?
a.
While accessing child nodes of an XMLList, the array access operator '[]' can
be used and the starting Index is 0.
b.
While accessing child nodes of an XMLList, the array access operator '[]' can
be used but the starting Index in this case is 1.
c.
While fetching children of an XMLList, the children() method of the XML class
can be used interchangeably with the '*' operator.
d. All
of the above statements are correct.