Skip to main content

Adobe Flex Interview Questions

1) What’s the difference between Java and AS3 getters and setters?


In Java, getter and setter methods have to be explicitly called.

While in AS3, they’re called automatically and externally

indistinguishable from public properties.

For instance trace(myClass.foo) might be referencing a public property

or it might be referencing the method “public get foo():Object”. It

makes no difference to an external class.



You can expand on this a bit more to describe why this is useful. The

implications are that, unlike in Java, all variables in a class are

generally public. Java standard practices are to create only public

getters and setters while keeping the variables private. The reason

for only allowing methods to be publicly accessible is so that 1) they

can be overridden and 2) their implementation can change without

altering class interface.


AS3 addresses both of these concerns because, as described above, a

public property can be replaced with a getter and setter without

changing the interface. And an inherited public property can actually

be overridden by a subclass.

For example, this is valid:

public class A

{

public var foo:Object;

}

public class B extends A

{

override public function get foo():Object{return ‘bar’};

override public function set foo(value:Object):void{};

}

2) Explain how binding works in mxml components.

Data binding is the process of tying the data in one object to another object. It provides a convenient way to pass data around in an application. Adobe Flex 2 provides three ways to specify data binding: the curly braces ({}) syntax and the tag in MXML and the BindingUtils methods in ActionScript.

Data binding requires a source property, a destination property, and a triggering event that indicates when to copy the data from the source to the destination. To use a property as the source of a data binding expression, the component must be implemented to support data binding, which means that the component dispatches an event when the value of the property changes to trigger the binding.

At compile time, the MXML compiler generates code to create ActionScript Watcher and Binding objects that correspond to the binding tags and expressions found in an MXML document. At run time, Watcher objects are triggered by change events that come from the constituent parts of binding source expressions; the Watcher objects then trigger Binding objects to execute bindings.

When you specify a property as the source of a data binding, Flex monitors not only that property for changes, but also the chain of properties leading up to it. The entire chain of properties, including the destination property, is called a “bindable property chain“. In the following example, firstName.text is a bindable property chain that includes both a firstName object and its text property:

{firstName.text}

Its not necessary that the binding executes automatically. In the following case the binding wont execute automatically as expected.

1. Binding does not execute automatically when you change an entire item of a dataProvider property.

2. Binding also does not execute automatically for subproperties of properties that have [Bindable] metadata.

3. Binding also does not execute automatically when you are binding data to a property that Flash Player updates automatically, such as the mouseX property.

The executeBindings() method of the UIComponent class executes all the bindings for which a UIComponent object is the destination. All containers and controls, as well as the Repeater component, extend the UIComponent class. The executeChildBindings() method of the Container and Repeater classes executes all of the bindings for which the child UIComponent components of a Container or Repeater class are destinations. All containers extend the Container class. However, you should only use the executeBindings() method when you are sure that bindings do not execute automatically.

3) What’s the difference between ChangeWatcher.watch, and

BindingUtils.bindProperty?

4) Why would you want to keep a reference to a ChangeWatcher and call

unwatch()?

5) How do you add event listeners in mxml components. Now AS3 components?

6) What does calling preventDefault() on an event do? How is this

enforced?

7) (If applicable) Explain the lifecycle of a Cairngorm action.

8 ) What are some ways to specify styles on components?

9) What is the problem with calling setStyle()

10) Explain the difference between creating an effect and setting the

target as opposed to adding an effectListener

11) What do repeater components do?

12) How do you identify a component created in a repeater?

13) Explain the component lifecycle.

14) How invalidate / commitProperties work specifically

15) Questions about dataServices

16) A general understanding of MVC

17) What frameworks familiar with

1. Is it possible to make httpService Requests synchronous?

2. I need to load an image from flickr into my application. Do I need a crossdomain.xml file on flickr?

3. What is the difference between httpService and Data Service?

Flex allows three types of RPC services: HttpService, WebServices, and RemoteObject Services. In Flex, using the “RemoteObjects specifies named or unnamed sources and connects to an Action Message Format (AMF) gateway, whereas using the HTTPService and WebService use named services or raw URLs and connect to an HTTP proxy using text-based query parameters or XML”. Specifically, HTTPServices use raw HTTP requests, WebServices use the SOAP protocol and RemoteObjects uses AMF3. “RemoteObject provides two advantages over HTTP or SOAP. First, while the AMF protocol uses HTTP to transfer packets, the data is transferred in a binary format that is natively understood by the Flash Player. As a result, data can move across the network more quickly and it can be deserialized more rapidly than text-based formats such as XML. Both of these result in performance gains, particularly where large sets of data are involved. Secondly, RemoteObject provides signficant productivity advantages. The remoting service, which runs on your server, automatically marshalls data between AMF and your server-side language (e.g., PHP, Java, C#). As a result, you can directly call methods on your PHP objects without having to write an XML REST interface or create web service interfaces”.

4. How do you generate random numbers within a given limit with actionscript?

5. Have you built any components with actionscript? If so explain how you did it?

6. How do you implement push on a flex applications?

7.I am going to add images into a tag. How will it resize itself?

8. What is a resource Manager??

9.What are the similarities between java and flex

10. What is the dynamic keyword used for?

11.How do you implement push with flex data services?

12. What are the methods called when a UI component is intialized?

13. How do you implement drag and drop on components that do not support ondrag and ondrop?

14.Can you write to the file system from flex?

15. What is a drag manager?

16 . HOw do you call javascript from Flex?

The ExternalInterface API makes it very simple to call methods in the enclosing wrapper. You use the static call() method, which has the following signature:

flash.external.ExternalInterface.call(function_name:

String[, arg1, ...]):Object;

The function_name is the name of the function in the HTML page’s JavaScript. The arguments are the arguments that you pass to the JavaScript function. You can pass one or more arguments in the traditional way of separating them with commas, or you can pass an object that is deserialized by the browser. The arguments are optional.

The following example script block calls the JavaScript f() function in the enclosing wrapper by using the call() method:



This feature requires that the embedded movie file have an id attribute. Without it, no call from your Flex application will succeed.

The call() method accepts zero or more arguments, which can be ActionScript types. Flex serializes the ActionScript types as JavaScript numbers and strings. If you pass an object, you can access the properties of that deserialized object in the JavaScript, as the following example shows:



public function callWrapper():void {

var o:Object = new Object();

o.lname = "Danger";

o.fname = "Nick";

var f:String = "sendComplexDataTypes";

ExternalInterface.call(f,o);

}


Flex only serializes public, nonstatic variables and read-write properties of ActionScript objects. You can pass numbers and strings as properties on objects, simple objects such as primitive types and arrays, or arrays of simple objects.

The JavaScript code can then access properties of the object, as the following example shows:



You can also embed objects within objects, as the following example shows. Add the following code in your Flex application’s

Flex and Flash Player have strict security in place to prevent cross-site scripting. By default, you cannot call script on an HTML page if the HTML page is not in the same domain as the Flex application. However, you can expand the sources from which scripts can be called.

You cannot pass objects or arrays that contain circular references. For example, you cannot pass the following object:

var obj = new Object();

obj.prop = obj; // Circular reference.

Circular references cause infinite loops in both ActionScript and JavaScript.

17. How do you use a repeater?

18. what are three ways to skin a component in flex?

19. How do you use css styles in flex?

20. What is the difference between sealed class and dynamic classes?

21.what is MVC and how do you relate it to flex apps?

22.what is state? what is the difference between states and ViewStack?

23.how does item renderer work? How do I add item renderer at runtime?

24.what keyword allows you to refer to private variables of a class?

25.how polymorphism works on actionscript?

26.how do you overload functions in actionscript?

27.what is dynamic keyword used for?

Dynamic Keyword is used to make a class dynamic. A dynamic class defines an object that can be altered at run time by adding or changing properties and methods. You create dynamic classes by using the dynamic attribute when you declare a class. For example, the following code creates a dynamic class named Protean:

dynamic class Protean {

private var privateGreeting:String = "hi";

public var publicGreeting:String = "hello";

function Protean () {

trace("Protean instance created");

}

}

If you subsequently instantiate an instance of the Protean class, you can add properties or methods to it outside the class definition. For example, the following code creates an instance of the Protean class and adds a property named aString and a property named aNumber to the instance:

var myProtean:Protean = new Protean();

myProtean.aString = "testing";

myProtean.aNumber = 3;

trace (myProtean.aString, myProtean.aNumber); // output: testing 3

Properties that you add to an instance of a dynamic class are run-time entities, so any type checking is done at run time. You cannot add a type annotation to a property that you add in this manner.

You can also add a method to the myProtean instance by defining a function and attaching the function to a property of the myProtean instance. The following code moves the trace statement into a method named traceProtean():

var myProtean:Protean = new Protean();

myProtean.aString = "testing";

myProtean.aNumber = 3;

myProtean.traceProtean = function () {

trace (this.aString, this.aNumber);

}

myProtean.traceProtean(); // output: testing 3

Methods created in this way, however, do not have access to any private properties or methods of the Protean class. Moreover, even references to public properties or methods of the Protean class must be qualified with either the this keyword or the class name. The following example shows the traceProtean() method attempting to access the private and public variables of the Protean class.

myProtean.traceProtean = function () {

trace(myProtean.privateGreeting); // output: undefined

trace(myProtean.publicGreeting); // output: hello

}

myProtean.traceProtean();

28.what are sealed classes ?

A class that is not dynamic, such as the String class, is a sealed class. You cannot add properties or methods to a sealed class at run time.

29 what are runtime shared libraries?

30.What is caringhorm ? how do you use it?Have you worked with Cairnghorn?

Overview of Cairngorm

What is Cairngorm? Cairngorm is fundamentally a methodology for breaking up your application code by logical functions; by data, by user views, and by the code that controls everything. This is routinely referred to as MVC, or Model, View, and Control.

The Pieces of Cairngorm

· · Model Locator: Stores all of your application’s Value Objects (data) and shared variables, in one place. Similar to an HTTP Session object, except thatits stored client side in the Flex interface instead of server side within a middle tier application server.

· · View: One or more Flex components (button, panel, combo box, Tile, etc) bundled together as a named unit, bound to data in the Model Locator, andgenerating custom Cairngorm Events based on user interaction (clicks,rollovers, dragndrop.)

· · Front Controller: Receives Cairngorm Events and maps them to CairngormCommands.

· · Command: Handles business logic, calls Cairngorm Delegates and/or other Commands, and updates the Value Objects and variables stored in the ModelLocator

· · Delegate: Created by a Command, they instantiate remote procedure calls(HTTP, Web Services, etc) and hand the results back to that Command.

· · Service: Defines the remote procedure calls (HTTP, Web Services, etc) to connect to remote data stores.

How the Pieces Fit Together

Cairngorm basically works like this: Your client interface is comprised of Views. The Views use Flex binding to display data contained in the Model Locator. The Viewsgenerate Events based on user gestures such as mouse click, button press, and drag & drop. Those Events are “broadcast” and “heard” by the Front Controller, which is a map of Events to Commands. Commands contain business logic, create Delegates toperform work, handle responses from Delegates, and update the data stored in theModel Locator. Since Views are bound to the data in the Model Locator the Viewsautomatically update when the Model Locator data is changed. Delegates callServices and hand results back to Commands, and are optional but recommended.Services make remote data calls and hand the results back to Delegates.

31.What keyword allows you to implement abstraction better?

32.What design patterns have you used? in Actionscript and java?

What is AMF?

AMF is a binary format based loosely on the Simple Object Access Protocol (SOAP). It is used primarily to exchange data between an Adobe Flash application and a database, using a Remote Procedure Call. Each AMF message contains a body which holds the error or response, which will be expressed as an ActionScript Object. AMF was introduced with Flash Player 6, and this version is referred to as AMF 0. It was unchanged until the release of Flash Player 9 and ActionScript 3.0, when new data types and language features prompted an update, called AMF 3.

Advantages / Disadvantages of flex

Flex advantages: very capable IDE, Images are part of a flash movie and can’t be downloaded directly, supported by Adobe, XML based language, ability to leverage flash components into the application, great speed increase over previous versions of flash (if that was even possible).

Flex disadvantages: Needs the flash player, Need to learn and XML based language and possibly actionscript to build real applications











import flash.external.*;



public function callWrapper():void {

var f:String = "changeDocumentTitle";

var m:String = ExternalInterface.call(f,"New Title");

trace(m);

}







On your HTML page, you define a function as you would any other JavaScript function. You can return a value, as the following example shows:



This feature requires that the embedded movie file have an id attribute. Without it, no call from your Flex application will succeed.

The call() method accepts zero or more arguments, which can be ActionScript types. Flex serializes the ActionScript types as JavaScript numbers and strings. If you pass an object, you can access the properties of that deserialized object in the JavaScript, as the following example shows:



public function callWrapper():void {

var o:Object = new Object();

o.lname = "Danger";

o.fname = "Nick";

var f:String = "sendComplexDataTypes";

ExternalInterface.call(f,o);

}



Flex only serializes public, nonstatic variables and read-write properties of ActionScript objects. You can pass numbers and strings as properties on objects, simple objects such as primitive types and arrays, or arrays of simple objects.

The JavaScript code can then access properties of the object, as the following example shows:



You can also embed objects within objects, as the following example shows. Add the following code in your Flex application’s

Flex and Flash Player have strict security in place to prevent cross-site scripting. By default, you cannot call script on an HTML page if the HTML page is not in the same domain as the Flex application. However, you can expand the sources from which scripts can be called.

You cannot pass objects or arrays that contain circular references. For example, you cannot pass the following object:

var obj = new Object();

obj.prop = obj; // Circular reference.

Circular references cause infinite loops in both ActionScript and JavaScript.

17. How do you use a repeater?

18. what are three ways to skin a component in flex?

19. How do you use css styles in flex?

20. What is the difference between sealed class and dynamic classes?

21.what is MVC and how do you relate it to flex apps?

22.what is state? what is the difference between states and ViewStack?

23.how does item renderer work? How do I add item renderer at runtime?

24.what keyword allows you to refer to private variables of a class?

25.how polymorphism works on actionscript?

26.how do you overload functions in actionscript?

27.what is dynamic keyword used for?

Dynamic Keyword is used to make a class dynamic. A dynamic class defines an object that can be altered at run time by adding or changing properties and methods. You create dynamic classes by using the dynamic attribute when you declare a class. For example, the following code creates a dynamic class named Protean:

dynamic class Protean {

private var privateGreeting:String = "hi";

public var publicGreeting:String = "hello";

function Protean () {

trace("Protean instance created");

}

}

If you subsequently instantiate an instance of the Protean class, you can add properties or methods to it outside the class definition. For example, the following code creates an instance of the Protean class and adds a property named aString and a property named aNumber to the instance:

var myProtean:Protean = new Protean();

myProtean.aString = "testing";

myProtean.aNumber = 3;

trace (myProtean.aString, myProtean.aNumber); // output: testing 3

Properties that you add to an instance of a dynamic class are run-time entities, so any type checking is done at run time. You cannot add a type annotation to a property that you add in this manner.

You can also add a method to the myProtean instance by defining a function and attaching the function to a property of the myProtean instance. The following code moves the trace statement into a method named traceProtean():

var myProtean:Protean = new Protean();

myProtean.aString = "testing";

myProtean.aNumber = 3;

myProtean.traceProtean = function () {

trace (this.aString, this.aNumber);

}

myProtean.traceProtean(); // output: testing 3

Methods created in this way, however, do not have access to any private properties or methods of the Protean class. Moreover, even references to public properties or methods of the Protean class must be qualified with either the this keyword or the class name. The following example shows the traceProtean() method attempting to access the private and public variables of the Protean class.

myProtean.traceProtean = function () {

trace(myProtean.privateGreeting); // output: undefined

trace(myProtean.publicGreeting); // output: hello

}

myProtean.traceProtean();

28.what are sealed classes ?

A class that is not dynamic, such as the String class, is a sealed class. You cannot add properties or methods to a sealed class at run time.

29 what are runtime shared libraries?

30.What is caringhorm ? how do you use it?Have you worked with Cairnghorn?

Overview of Cairngorm

What is Cairngorm? Cairngorm is fundamentally a methodology for breaking up your application code by logical functions; by data, by user views, and by the code that controls everything. This is routinely referred to as MVC, or Model, View, and Control.

The Pieces of Cairngorm

· · Model Locator: Stores all of your application’s Value Objects (data) and shared variables, in one place. Similar to an HTTP Session object, except thatits stored client side in the Flex interface instead of server side within a middle tier application server.

· · View: One or more Flex components (button, panel, combo box, Tile, etc) bundled together as a named unit, bound to data in the Model Locator, andgenerating custom Cairngorm Events based on user interaction (clicks,rollovers, dragndrop.)

· · Front Controller: Receives Cairngorm Events and maps them to CairngormCommands.

· · Command: Handles business logic, calls Cairngorm Delegates and/or other Commands, and updates the Value Objects and variables stored in the ModelLocator

· · Delegate: Created by a Command, they instantiate remote procedure calls(HTTP, Web Services, etc) and hand the results back to that Command.

· · Service: Defines the remote procedure calls (HTTP, Web Services, etc) to connect to remote data stores.

How the Pieces Fit Together

Cairngorm basically works like this: Your client interface is comprised of Views. The Views use Flex binding to display data contained in the Model Locator. The Viewsgenerate Events based on user gestures such as mouse click, button press, and drag & drop. Those Events are “broadcast” and “heard” by the Front Controller, which is a map of Events to Commands. Commands contain business logic, create Delegates toperform work, handle responses from Delegates, and update the data stored in theModel Locator. Since Views are bound to the data in the Model Locator the Viewsautomatically update when the Model Locator data is changed. Delegates callServices and hand results back to Commands, and are optional but recommended.Services make remote data calls and hand the results back to Delegates.

31.What keyword allows you to implement abstraction better?

32.What design patterns have you used? in Actionscript and java?

What is AMF?

AMF is a binary format based loosely on the Simple Object Access Protocol (SOAP). It is used primarily to exchange data between an Adobe Flash application and a database, using a Remote Procedure Call. Each AMF message contains a body which holds the error or response, which will be expressed as an ActionScript Object. AMF was introduced with Flash Player 6, and this version is referred to as AMF 0. It was unchanged until the release of Flash Player 9 and ActionScript 3.0, when new data types and language features prompted an update, called AMF 3.

Advantages / Disadvantages of flex

Flex advantages: very capable IDE, Images are part of a flash movie and can’t be downloaded directly, supported by Adobe, XML based language, ability to leverage flash components into the application, great speed increase over previous versions of flash (if that was even possible).

Flex disadvantages: Needs the flash player, Need to learn and XML based language and possibly actionscript to build real applications







public function callWrapper():void {

var f:String = "sendComplexDataTypes";

var o:Object = new Object();

o.lname = "Danger";

o.fname = "Nick";

o.b = new Array("DdW","E&T","LotR:TS");

var m:String = ExternalInterface.call(f,o);

}



The code triggers the following JavaScript in the wrapper:



Flex and Flash Player have strict security in place to prevent cross-site scripting. By default, you cannot call script on an HTML page if the HTML page is not in the same domain as the Flex application. However, you can expand the sources from which scripts can be called.

You cannot pass objects or arrays that contain circular references. For example, you cannot pass the following object:

var obj = new Object();

obj.prop = obj; // Circular reference.

Circular references cause infinite loops in both ActionScript and JavaScript.

17. How do you use a repeater?

18. what are three ways to skin a component in flex?

19. How do you use css styles in flex?

20. What is the difference between sealed class and dynamic classes?

21.what is MVC and how do you relate it to flex apps?

22.what is state? what is the difference between states and ViewStack?

23.how does item renderer work? How do I add item renderer at runtime?

24.what keyword allows you to refer to private variables of a class?

25.how polymorphism works on actionscript?

26.how do you overload functions in actionscript?

27.what is dynamic keyword used for?

Dynamic Keyword is used to make a class dynamic. A dynamic class defines an object that can be altered at run time by adding or changing properties and methods. You create dynamic classes by using the dynamic attribute when you declare a class. For example, the following code creates a dynamic class named Protean:

dynamic class Protean {

private var privateGreeting:String = "hi";

public var publicGreeting:String = "hello";

function Protean () {

trace("Protean instance created");

}

}

If you subsequently instantiate an instance of the Protean class, you can add properties or methods to it outside the class definition. For example, the following code creates an instance of the Protean class and adds a property named aString and a property named aNumber to the instance:

var myProtean:Protean = new Protean();

myProtean.aString = "testing";

myProtean.aNumber = 3;

trace (myProtean.aString, myProtean.aNumber); // output: testing 3

Properties that you add to an instance of a dynamic class are run-time entities, so any type checking is done at run time. You cannot add a type annotation to a property that you add in this manner.

You can also add a method to the myProtean instance by defining a function and attaching the function to a property of the myProtean instance. The following code moves the trace statement into a method named traceProtean():

var myProtean:Protean = new Protean();

myProtean.aString = "testing";

myProtean.aNumber = 3;

myProtean.traceProtean = function () {

trace (this.aString, this.aNumber);

}

myProtean.traceProtean(); // output: testing 3

Methods created in this way, however, do not have access to any private properties or methods of the Protean class. Moreover, even references to public properties or methods of the Protean class must be qualified with either the this keyword or the class name. The following example shows the traceProtean() method attempting to access the private and public variables of the Protean class.

myProtean.traceProtean = function () {

trace(myProtean.privateGreeting); // output: undefined

trace(myProtean.publicGreeting); // output: hello

}

myProtean.traceProtean();

28.what are sealed classes ?

A class that is not dynamic, such as the String class, is a sealed class. You cannot add properties or methods to a sealed class at run time.

29 what are runtime shared libraries?

30.What is caringhorm ? how do you use it?Have you worked with Cairnghorn?

Overview of Cairngorm

What is Cairngorm? Cairngorm is fundamentally a methodology for breaking up your application code by logical functions; by data, by user views, and by the code that controls everything. This is routinely referred to as MVC, or Model, View, and Control.

The Pieces of Cairngorm

· · Model Locator: Stores all of your application’s Value Objects (data) and shared variables, in one place. Similar to an HTTP Session object, except thatits stored client side in the Flex interface instead of server side within a middle tier application server.

· · View: One or more Flex components (button, panel, combo box, Tile, etc) bundled together as a named unit, bound to data in the Model Locator, andgenerating custom Cairngorm Events based on user interaction (clicks,rollovers, dragndrop.)

· · Front Controller: Receives Cairngorm Events and maps them to CairngormCommands.

· · Command: Handles business logic, calls Cairngorm Delegates and/or other Commands, and updates the Value Objects and variables stored in the ModelLocator

· · Delegate: Created by a Command, they instantiate remote procedure calls(HTTP, Web Services, etc) and hand the results back to that Command.

· · Service: Defines the remote procedure calls (HTTP, Web Services, etc) to connect to remote data stores.

How the Pieces Fit Together

Cairngorm basically works like this: Your client interface is comprised of Views. The Views use Flex binding to display data contained in the Model Locator. The Viewsgenerate Events based on user gestures such as mouse click, button press, and drag & drop. Those Events are “broadcast” and “heard” by the Front Controller, which is a map of Events to Commands. Commands contain business logic, create Delegates toperform work, handle responses from Delegates, and update the data stored in theModel Locator. Since Views are bound to the data in the Model Locator the Viewsautomatically update when the Model Locator data is changed. Delegates callServices and hand results back to Commands, and are optional but recommended.Services make remote data calls and hand the results back to Delegates.

31.What keyword allows you to implement abstraction better?

32.What design patterns have you used? in Actionscript and java?

What is AMF?

AMF is a binary format based loosely on the Simple Object Access Protocol (SOAP). It is used primarily to exchange data between an Adobe Flash application and a database, using a Remote Procedure Call. Each AMF message contains a body which holds the error or response, which will be expressed as an ActionScript Object. AMF was introduced with Flash Player 6, and this version is referred to as AMF 0. It was unchanged until the release of Flash Player 9 and ActionScript 3.0, when new data types and language features prompted an update, called AMF 3.

Advantages / Disadvantages of flex

Flex advantages: very capable IDE, Images are part of a flash movie and can’t be downloaded directly, supported by Adobe, XML based language, ability to leverage flash components into the application, great speed increase over previous versions of flash (if that was even possible).

Flex disadvantages: Needs the flash player, Need to learn and XML based language and possibly actionscript to build real applications






public function callWrapper():void {

var f:String = "sendComplexDataTypes";

var o:Object = new Object();

o.lname = "Danger";

o.fname = "Nick";

o.b = new Array("DdW","E&T","LotR:TS");

var m:String = ExternalInterface.call(f,o);

}


The code triggers the following JavaScript in the wrapper:



Flex and Flash Player have strict security in place to prevent cross-site scripting. By default, you cannot call script on an HTML page if the HTML page is not in the same domain as the Flex application. However, you can expand the sources from which scripts can be called.

You cannot pass objects or arrays that contain circular references. For example, you cannot pass the following object:

var obj = new Object();

obj.prop = obj; // Circular reference.

Circular references cause infinite loops in both ActionScript and JavaScript.

17. How do you use a repeater?

18. what are three ways to skin a component in flex?

19. How do you use css styles in flex?

20. What is the difference between sealed class and dynamic classes?

21.what is MVC and how do you relate it to flex apps?

22.what is state? what is the difference between states and ViewStack?

23.how does item renderer work? How do I add item renderer at runtime?

24.what keyword allows you to refer to private variables of a class?

25.how polymorphism works on actionscript?

26.how do you overload functions in actionscript?

27.what is dynamic keyword used for?

Dynamic Keyword is used to make a class dynamic. A dynamic class defines an object that can be altered at run time by adding or changing properties and methods. You create dynamic classes by using the dynamic attribute when you declare a class. For example, the following code creates a dynamic class named Protean:

dynamic class Protean {

private var privateGreeting:String = "hi";

public var publicGreeting:String = "hello";

function Protean () {

trace("Protean instance created");

}

}

If you subsequently instantiate an instance of the Protean class, you can add properties or methods to it outside the class definition. For example, the following code creates an instance of the Protean class and adds a property named aString and a property named aNumber to the instance:

var myProtean:Protean = new Protean();

myProtean.aString = "testing";

myProtean.aNumber = 3;

trace (myProtean.aString, myProtean.aNumber); // output: testing 3

Properties that you add to an instance of a dynamic class are run-time entities, so any type checking is done at run time. You cannot add a type annotation to a property that you add in this manner.

You can also add a method to the myProtean instance by defining a function and attaching the function to a property of the myProtean instance. The following code moves the trace statement into a method named traceProtean():

var myProtean:Protean = new Protean();

myProtean.aString = "testing";

myProtean.aNumber = 3;

myProtean.traceProtean = function () {

trace (this.aString, this.aNumber);

}

myProtean.traceProtean(); // output: testing 3

Methods created in this way, however, do not have access to any private properties or methods of the Protean class. Moreover, even references to public properties or methods of the Protean class must be qualified with either the this keyword or the class name. The following example shows the traceProtean() method attempting to access the private and public variables of the Protean class.

myProtean.traceProtean = function () {

trace(myProtean.privateGreeting); // output: undefined

trace(myProtean.publicGreeting); // output: hello

}

myProtean.traceProtean();

28.what are sealed classes ?

A class that is not dynamic, such as the String class, is a sealed class. You cannot add properties or methods to a sealed class at run time.

29 what are runtime shared libraries?

30.What is caringhorm ? how do you use it?Have you worked with Cairnghorn?

Overview of Cairngorm

What is Cairngorm? Cairngorm is fundamentally a methodology for breaking up your application code by logical functions; by data, by user views, and by the code that controls everything. This is routinely referred to as MVC, or Model, View, and Control.

The Pieces of Cairngorm

· · Model Locator: Stores all of your application’s Value Objects (data) and shared variables, in one place. Similar to an HTTP Session object, except thatits stored client side in the Flex interface instead of server side within a middle tier application server.

· · View: One or more Flex components (button, panel, combo box, Tile, etc) bundled together as a named unit, bound to data in the Model Locator, andgenerating custom Cairngorm Events based on user interaction (clicks,rollovers, dragndrop.)

· · Front Controller: Receives Cairngorm Events and maps them to CairngormCommands.

· · Command: Handles business logic, calls Cairngorm Delegates and/or other Commands, and updates the Value Objects and variables stored in the ModelLocator

· · Delegate: Created by a Command, they instantiate remote procedure calls(HTTP, Web Services, etc) and hand the results back to that Command.

· · Service: Defines the remote procedure calls (HTTP, Web Services, etc) to connect to remote data stores.

How the Pieces Fit Together

Cairngorm basically works like this: Your client interface is comprised of Views. The Views use Flex binding to display data contained in the Model Locator. The Viewsgenerate Events based on user gestures such as mouse click, button press, and drag & drop. Those Events are “broadcast” and “heard” by the Front Controller, which is a map of Events to Commands. Commands contain business logic, create Delegates toperform work, handle responses from Delegates, and update the data stored in theModel Locator. Since Views are bound to the data in the Model Locator the Viewsautomatically update when the Model Locator data is changed. Delegates callServices and hand results back to Commands, and are optional but recommended.Services make remote data calls and hand the results back to Delegates.

31.What keyword allows you to implement abstraction better?

32.What design patterns have you used? in Actionscript and java?

What is AMF?

AMF is a binary format based loosely on the Simple Object Access Protocol (SOAP). It is used primarily to exchange data between an Adobe Flash application and a database, using a Remote Procedure Call. Each AMF message contains a body which holds the error or response, which will be expressed as an ActionScript Object. AMF was introduced with Flash Player 6, and this version is referred to as AMF 0. It was unchanged until the release of Flash Player 9 and ActionScript 3.0, when new data types and language features prompted an update, called AMF 3.

Advantages / Disadvantages of flex

Flex advantages: very capable IDE, Images are part of a flash movie and can’t be downloaded directly, supported by Adobe, XML based language, ability to leverage flash components into the application, great speed increase over previous versions of flash (if that was even possible).

Flex disadvantages: Needs the flash player, Need to learn and XML based language and possibly actionscript to build real applications



Comments

Popular posts from this blog

Asynchronous Vs. Synchronous Communications

Synchronous (One thread):   1 thread -> |<---A---->||<----B---------->||<------C----->| Synchronous (multi-threaded):   thread A -> |<---A---->| \ thread B ------------> ->|<----B---------->| \ thread C ----------------------------------> ->|<------C----->|

WebSphere MQ Interview Questions

What is MQ and what does it do? Ans. MQ stands for MESSAGE QUEUEING. WebSphere MQ allows application programs to use message queuing to participate in message-driven processing. Application programs can communicate across different platforms by using the appropriate message queuing software products. What is Message driven process? Ans . When messages arrive on a queue, they can automatically start an application using triggering. If necessary, the applications can be stopped when the message (or messages) have been processed. What are advantages of the MQ? Ans. 1. Integration. 2. Asynchrony 3. Assured Delivery 4. Scalability. How does it support the Integration? Ans. Because the MQ is independent of the Operating System you use i.e. it may be Windows, Solaris,AIX.It is independent of the protocol (i.e. TCP/IP, LU6.2, SNA, NetBIOS, UDP).It is not required that both the sender and receiver should be running on the same platform What is Asynchrony? Ans. With messag

Advantages & Disadvantages of Synchronous / Asynchronous Communications?

  Asynchronous Communication Advantages: Requests need not be targeted to specific server. Service need not be available when request is made. No blocking, so resources could be freed.  Could use connectionless protocol Disadvantages: Response times are unpredictable. Error handling usually more complex.  Usually requires connection-oriented protocol.  Harder to design apps Synchronous Communication Advantages: Easy to program Outcome is known immediately  Error recovery easier (usually)  Better real-time response (usually) Disadvantages: Service must be up and ready. Requestor blocks, held resources are “tied up”.  Usually requires connection-oriented protocol