Search This Blog

Wednesday, January 27, 2010

Interview questions AS2


1) Difference between root & parent
Root: Absolute path (refer to stage)
Parent: Relative path
2) Level & Depth
Level: We can maintain only one depth at a level.
Depth: We can maintain any number of level in a depth.
  1. Loadvariables : Used to load text file in movieclip
Loadvariablenum: Used to load text file in level
4) loadmovie : Used to load external files (swf, image) in a movie clip
Loadmovienum: Used to load external files (swf, image) in level
5) Movieclip loader:
Used to load external files. It act as a pre-loader. We can monitor whether file is download or not.
6) Local to global:
Converts movie clip co-ordinates into stage co-ordinates
Global to local:
Converts stage co-ordinates into movie clip co-ordinates
7) Loadvars & XML:
Both are class used to communicate serve side pages.
8) HTML limitation in XML:
i) We cannot create tables
ii) We cannot create frames
9) onEnterFrame & setInterval:
i) Both are functions
ii) onEnterFrame is based on frame rate to control object
iii) setInterval is based on a particular interval of time to control objects.
10) Shared library:
It is used to share the components in different documents either in run time or design.
11) Shared object:
They are flash environment cookies that stores client information either in local or remote system.
12) External Interface class:
We can communicate by sending datas from flash to java script or vice versa.
13) How do communicate flash with java script?
Using flash vars (variables) we can transfer data from Java script to flash.
14) AMF – Action Message Formatting
AVM – Action script Virtual Machine
15) Condense white property:
It’s a Boolean value that specifies whether extra white space (space, line break) in an HTML text field should be removed when the field is rendered in a browser. The default value is false.
16) Difference between AS-2 & AS-3
AS-2:
  1. All codes are compiled and executed by AVM-1
  2. We cannot achieve polymorphism effectively
  3. We cannot use package concept more flexible
  4. We can create dynamic variables for movie clip
  5. XML dom is used to process xml document.
AS-3:
  1. All codes are compiled and executed by AVM-2 (it performs 10 times faster than AVM-1)
  2. We can achieve polymorphism effectively.
  3. We can use package concept more flexible
  4. We cannot create dynamic variables for movie clip because they are using sealed class (sprite). They don’t have separate time line
  5. E4X concept is used to process XML documents.

Difference between _root and _level0

Main file and Loaded file      
if both file has a variable named as myVal

eg myVal=5 (in the  loaded .swf)
     myVal=100 (in the main.swf)

now trace the value using _level0 and _root in the loaded swf

trace(_level0.myVal+"                       "+_root.myVal)

Output:
//--------------------------------
100                                5

_level0 references the main Timeline of all swf.
_root references the main Timeline in the level which loaded. as we have loaded in the level2.