Important Action Script Interview Questions
Q – 1 Tell me what is the main purpose of ActionScript?
Ans-
– ActionScript provides an object oriented approach to develop the ECMAScript and it provides the syntax and the semantics for the language.
– ActionScript is used for the web development and creation of the website by using the embedded SWF files.
– ActionScript allows the creation of controlling the 2D vector animations and it focuses more on the flash.
– It provides added functionality to the overall system and it allows the use of the scripting capabilities.
– ActionScript provides a suitable way to create database applications and provide the Kit to use the scripting language.
Q – 2 Explain what are the features provided by ActionScript 3.0?
Ans-
– ActionScript 3.0 allows a framework to provide object oriented features and write the program easily.
– Scripting language can be used to animate the designs and provide flexibility at the same time editing features.
– It provides more control and code reusability of the applications that are made in flash and is complex.
– It provides a platform that gets compiled and uses the ActionScript Virtual Machine for the reusability of the code.
– The Flash libraries can be used that have the XML capabilities and use the content rich browser to display it.
Q – 3 Do you know what are the ways in which ActionScript’s code can be protected?
Ans-
– The animation and flash is the technology that doesn’t get exposed much due to the restrictions in their domain areas.
– The use of intermediate language makes it easy for the compiled code that is saved in a local file.
– The local file code can be decompiled into the source code and assets that is being used by ActionScript.
– ActionScirpt, uses obfuscators that provides, the protection, of the source code, and uses lexical transformations like identifier renaming, control flow transformation, etc.
– The use of obfuscators makes it impossible for decompilers to generate the output of source code.
Q – 4 How to write a program to create custom list in ActionScript?
Ans-
– To create the custom list there is a need of the parent to child relationship and a hierarchy needs to be maintained.
– There is a way to access the parent and children without or with adding of new nodes in the link.
– To create a custom list in ActionScript there is a need of the variables and listing:
package{
import fl.controls.List;
import fl.controls.Label;
import flash.display.*;
import flash.events.Event;
import flash.net.URLRequest;
import flash.events.IOErrorEvent;
public class ListTest extends MovieClip{
public function ListTest(){
var imageHolder = new MovieClip();
imageHolder.width = 140;
imageHolder.height = 140;
var theSprite = new Sprite();
theSprite.height = 150;
var theMsg = new Label();
theMsg.text = “something”;
theSprite.addChild(theMsg);
trace(“text = ” + theSprite.getChildAt(0).text);
}
Q – 5 Do you know how does removal of actual objects and data work in ActionScript?
Ans-
– The reference of an object can be removed by using the delete keyword in the ActionScript.
– The actual objects and data can be removed by using the garbage collector and it allows the checking of the object to take place for the memory space.
– If no memory space is found being allocated then the object gets removed from the memory.
– To manage the memory the application need to have a developed settings like:
var item1:XML=new XML(“”);
delete item1;
Q – 6 Can you explain what are the differences between JavaScript and ActionScript?
Ans-
– ActionScript consists of more libraries than the JavaScript and it is based on ECMA-262.
– JavaScript is used within the browser’s Document that shows the DOM in the window.
– DOM stands for Document Object Model are used in the browser window and have form centric documents for the JavaScript, whereas ActionScript doesn’t run in the browser window and have the media centric approach.
– The extensions are more supported in ActionScript than the JavaScript as it doesn’t provide the unique extension features.
Q – 7 Do you know what does reference means in ActionScript?
Ans-
– Reference is a pointer in the ActionScript that defines the instance of a class to be called using different objects.
– The ActionScript reference doesn’t create any copy of the instance but it allows the accessing to be made of the same memory space.
– ActionScript references are made up of objects and not copied to be used with other services.
– The example of it is as follows:
var item1:XML=new XML(“”);
var item2:XML=item1;
item2.firstChild.attributes.value=13;
Q – 8 Tell me what are the different ways in which the variables can be assigned?
Ans-
– The primitive data types are used as a variable to pass it to the function and use it inside the code.
– XML is passed to the function to alter the variable passed in the function having the original variable.
– The data types can be assigned with values that has literals are as follows:
var item1:String=”ABC”;
var item2:Boolean=true;
var item3:Number=12;
var item4:Array=[“a”,”b”,”c”];
var item5:Object={name:”Actionscript”,version:”3.0″};
var item6:XML = ;
Q – 9 Can you explain what are the changes presented by ActionScript?
Ans-
– ActionScript removed the differences between the primitive and reference types that are made in the object oriented languages.
– ActionScript considers all variables as references types and provide way to inherit the features easily.
– Objects belong to the primitive data types of the ActionScript and use the special operators to pass the value.
– Variables are of primitive type and the data types are used as a parameter to be passed to a function.
– The variables can be used inside the function without altering the original values used in other functions.
Q – 10 How to write a program that shows the usage of data types?
Ans- – The program shows:
var yourVariableName:YourVariableType = new YourVariableType(Param1, Param2, …, ParamN);
– This defines the variable type and constructs a new object with some parameter values.
– To create new empty object first a variable needs to be assigned and then the object needs to be created like:
var myObject:Object = new Object();
– The variables provide automatic assigning of the characters to the variable that is being created.
var myString:String = “Hello Wikipedia!”;
var myNumber:Number = 5;
Q – 11 Tell me what are the functions used with flash media?
Ans- The functions that are involved with the flash media are as follows:
– Error:
this occurs when it is for the generic object that allows the reporting to be made for the runtime errors.
– The errors are thrown out as an exception and then catched using the exception handler.
– Function:
this provides the basic class files and flash method definitions that allow the application to be created and made simpler.
– RegExp is abbreviated for regular expression for an object that is used for strings and provides a way to include the features of it.
– flash.media:
Video – provides an object of the playback that supports the direct transportation of the video in the MP4 format.
Q – 12 Do you know what is the difference between an Array and Vector?
Ans-
– Array is a list of characters stored in a contiguous memory locations whereas, vectors can be stored according to the memory allocated.
– Arrays are written in ActionScript and the type of array can be any and it can consist of any values as well whereas, the vector consists of multi-dimensional arrays.
– Arrays provide a way to retrieve the values and are easy to use, whereas vectors are not that easy to use and require manipulative tasks to be performed.
– Arrays are not typed and don’t use any other array form, whereas vectors are typed and uses arrays where the value of it either remains defined or null.
– There is no bound checking on arrays, whereas there are boundary checking’s that has been performed on vectors.
Q – 13 Explain what are the different utils libraries in ActionScript?
Ans- The libraries of Flash utils in ActionScript are as follows:
– flash.utils:Dictionary – this consists of the dictionaries that has an object with different keys of any kind of data types.
– flash.display:Sprite – this consists of a display object container that doesn’t have the support of the timeline.
– flash.display:MovieClip – this provide a display object to run the animated movie clip.
– This consists of the timeline for the flash file by default and gives the input in the MovieClip.
– flash.display:Bitmap – this displays an object for the non-animated bitmap file.
– flash.display:Shape – this consists of the shape object that are non-animated and vectors in nature.
– flash.utils:ByteArray – this consists of the array type in the binary format and allow the creation of the simple applications.
Q – 14 Can you explain what does the void function and object contain in ActionScript?
Ans-
– The void is a data type that consists of one value and the type is not defined as it is same as having null value.
– The undefined values are used in the object classes and the instances are described in it.
– The value used in the Object instance is null and it uses complex data types as well to represent it.
– The object class uses the data type of object and it is used to call other classes’ data as well.
– The object class that is being given act as a base class and the definitions that are written for it is present in the ActionScript.
– The objects consist of the key value pairs and form associative arrays that consist of the keys of String type.
Q – 15 Tell me what are the features involved in updating a language?
Ans- The features involved in updating the language of the Action Script are as follows:
– There exists a compile-time and run-time type checking that allow better checking of the information for errors.
– The performance monitoring of the system from a class based inheritance system that have the separation being done with the prototype based inheritance.
– It supports different types of packages, with the namespaces and regular expressions that can be used with the applications.
– The compiler compiles the application to the bytecode that is a new type and compatible with the ActionScript 3.0.
– It provides a way to provide a mechanism for event handling that is with the event handling standard.
Q – 16 Explain what are the data types supported by ActionScript?
Ans-
– ActionScripts consists of fundamental data types that allow users to create different types of data types.
The data types are defined in levels as follows:
– String: this is a collection of characters in the form of “Hello World” and it is useful to display it in a continuous form.
– Number: this consists of the numeric values that can be decimal form as well.
– Boolean: this consists of the binary format values that can have only values either “true” or “false”.
– Object: this is used as a data type and has the complex data type to inherit the properties from the other objects or classes.
– This way it provides flexibility to group the methods, functions and other objects.
Q – 17 How to write a program to show the external ActionScript?
Ans-
– The code that is created allows the text field with the positions, depth and the screen to be filled up.
– The parameters need to be set up using the following functions:
createTextField(“hello”, 0, 0, 0, 100, 100);
hello.text = “Hello, world”;
– The external ActionScript can be written using the class files and then describing the dimensions and other parameters related to it.
– The external ActionScript is written as such:
class com.example.Hello extends HelloWorld
{
public function Hello() {}
public function onLoad():Void
{
var txtHello:TextField = this.createTextField(“txtHello”, 0, 0, 0, 100, 100);
txtHello.text = “Hello, world”;
}
}
Q – 18 Do you know what are the different primitive data types used in ActionScript?
Ans- There are three different types of primitive data types that exist:
– Boolean – this data type deals in only two values either it can be true or false. It is also donates as 1 or 0.
– There are no other values that can be valid for Boolean data types and it is used mostly in conditional statements.
– int – this is the data type that is of 32 bit and it has the range in between -2,147,483,648 and 2,147,483,647.
– Null – this data type defines only one value that is NULL and this is the default value used in the String data type.
– These values are used in classes with other complex data types and it includes the object classes as well.
Q – 19 How to write a program use a text field and display it using the ActionScript?
Ans-
– The ActionScript uses some APIs to create the objects to display it using the scripts and different functions.
– The text field is accessed and created using the following functions as shown below:
var hello:TextField = new TextField();
hello.text = “Hello World”;
this.addChild(hello);
– The program that is written is complex and larger in size to be displayed at faster pace on the browser.
– The program show the use of text field in an object oriented manner with the help of IDE and other programs and it is shown as:
package com.example
{
import flash.text.TextField;
import flash.display.Sprite;
public class Greeter extends Sprite
{
public function Greeter()
{
var txtHello:TextField = new TextField();
txtHello.text = “Hello World”;
addChild(txtHello);
}
}
}