Search Flex Components Free

Custom Search
Showing posts with label Flex Interview Questions. Show all posts
Showing posts with label Flex Interview Questions. Show all posts

June 10, 2009

Questions in Flex

How does item renderer work? How do I add item renderer at runtime?
Item renderer is a class, that you use in a factory pattern. i.e. many controls that have to have repeatable parts that may be rendered using instances of some visual class may have item renderers.
Imagine this pseudo code:
[class ItemRenderer]
- set data();
- fieldA;
- fieldB;
[class VisualControl]
- factory = ItemRenderer;
- set data();

in VisualControl.[set data] you iterate through the collection of subsets of data and create new VisualControl.factory, then set that new VisualControl.factory instance's data property to that subset of data you want it to display.
say, your data looks like this:
Code:

Lorem
ipsum


Lorem
ipsum

Then, you'll create a VisualControl with 2 item renderers each of them will display in fieldA text "Lorem" and in fieldB "ipsum".

What is itemRenderer in Flex?

1. Item renderers are classes that draw the view of certain components, e.g. the MenuItemRenderer class draws the view for the Menu and MenuBar components. If you wanted to change the way a menu component looked without changing it's underlying functionality, you could write a custom item renderer class for it and assign it to the components itemRenderer property. There's more info on this here:
http://livedocs.adobe.com/flex/3/htm...enderer_2.html

2. By data linking, did you mean data binding? This is just a means of linking properties and variables together, so that when ones changes, so does the other.

3. The mxml gets complied into actionscript before getting complied into actionscript bytecode (in an swf). If you add the '-keep-generated-actionscript' tag to your mxml compiler, you can look at all the actionscript that gets written for you from your mxml.

4. An SWC can be used as a runtime shared library, or statically. If you use it as a RSL, then the components don't get compiled into your swf, but are loaded in at runtime, instead of all getting included in your swf at compile tim

June 9, 2009

Flex 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 createActionScript 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.

he 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 Repeatercomponent, extend the UIComponent class. TheexecuteChildBindings() method of the Container and Repeater classes executes all of the bindings for which the childUIComponent 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:

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 dynamicclass 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 namedProtean:

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

80 Flex Interview Questions

Q 1. Types of Binding
Ans: Using the curly braces ({}) syntax
Using ActionScript expressions in curly braces
Using the tag in MXML
Using bindings in ActionScript(BindingUtils)

Q 2. How to create your own event
Ans: Creating a subclass from the Event class
Using the Event metadata tag
Dispatching an event

Q 3. Event Bubbling
Ans: The mechanism through which event objects are passed from the objects that generates an event up through the containership hierarchy

Q 4. Life cycle of Flex Application/Component?
Ans: Preinitialize: The application has been instantiated but has not yet created any child components.
Initialize: The application has created child components but has not yet laid out those components.
creationComplete: The application has been completely instantiated and has laid out all components

Q 5. How you implement MVC in your Application
Ans: Cairngorm is based on the MVC model. It is specifically designed to facilitate complex state and data synchronization between the client and the server, while keeping the programming of the View layer detached from the data implementation.
The role of the View layer in a Cairngorm application is to throw events and bind to data stored in the Model. Components on the View can bind to Value Objects or other properties in the Model (data) layer.
In a Cairngorm Model, related data are stored in Value Objects (VOs), while simple variables can be stored as direct properties of the ModelLocator class. A static reference to the ModelLocator singleton instance is used by the View layers to locate the required data.
The Controller is the most sophisticated part of the Cairngorm architecture. The Controller layer is implemented as a singleton FrontController. The FrontController instance, which receives every View-generated event, dispatches the events to the assigned Command class based on the event's declared type.
The Command class then processes the event by running the Command class' execute() method, which is an ICommand interface method. The event object may include additional data if required by the developer. The execute() method can update the central Model, as well as invoke a Service class which typically involves communication with a remote server. The IResponder interface, which is also implemented by the Command class, includes onResult and onFault methods to handle responses returned from the invoked remote service.

Q 6. Difference btw Java and Flex Getters Setters
Ans: When it comes to getters and setters, Java and AS are quite different, in that getters and setters are part of the core ECMAScript language, whereas in Java, getters and setters are done through a naming convention.
In Java, it is almost never a good idea to make member variables public. If you do decide to make member variables public and then later want to change the interface to use getter/setter functions, you will have to modify all callers of your interfaces, which is onerous at best and in many cases, not possible (expecially when you are creating code that is used by other people).
Meanwhile, in ECMAScript, the externally visible interface doesn’t change when I go from a member variable to a getter/setter and back again. In some sense, the interface hiding is already accomplished in the language. Creating public member variables is “safe” in this sense.
Perhaps this is already obvious to all the AS-heads out there, but it took me a bit of time to get used to the concept.

Q 7. How many events are fired when your focus goes in one text box, you enter some text and then press tab.
Ans: PreinitializeHandler(), initializeHandler(), itemEditBegin, itemEditEnd, creationComplete()

Q 8. How you use styles different ways of using Style sheet
Ans: Using external style sheets, Using local style definitions, Using the StyleManager class ,Using the setStyle() and getStyle() methods, Using inline stylesLoading style sheets at run time

Q 9. How can you use two Styles at the same time
Ans: Using external style sheets and use Inline style commands

Q 10. Try to remember properties of few imp components
Ans:
< id="WeatherService" wsdl="http:/example.com/ws/WeatherService?wsdl" useproxy="false">
< !-- Bind the value of the ZIP code entered in the TextInput control to the ZipCode parameter of the GetWeather operation. -->
< name="GetWeather">

<>{zip.text}
< /mx:request>
< /mx:operation>


Q 11. What is the difference between Flex 2.0 and Flex 3.0
Ans: Enhanced Features like Faster compilation time, SWF file size reduction, Flex/Ajax bridge, Advanced Datagrid, Interactive debugging, Cross-Domain, Versionable, Easy to Use,Security and Code Signing,Failover and Hosting,Cross-Domain RSL, Advanced DatagridDeep Linking, Resource Bundles and Runtime Localization, Flex Component Kit for Flash CS3, Compilation, Language IntelligenceRefactoring, Class Outline,Code Search, Profiler, Module Support, Multiple SDK Support, Skin Importer, Design View Zoom/Pan,Design Mode support for ItemRenderers, Advanced Constraints, CS3 Suite integration, CSS Outline, CSS Design View, Flex 3 SDK Skinning/Style Enhancements

Q 12. How will you call Java method from Flex?
Ans: Using RemoteObject. Explain the process to interviewer

Q 13. What are the config files used for connecting Java and Flex?
Ans:
data-management-config.xml,
messaging-config.xml,
proxy-config.xml,
remoting-config.xml,
services-config.xml

Q 14. What are the channels and their types
Ans: The Channel class is the base message channel class that all channels in the messaging system must extend.
Channels are specific protocol-based conduits for messages sent between MessageAgents and remote destinations. Preconfigured channels are obtained within the framework using the ServerConfig.getChannel() method. You can create a Channel directly using the new operator and add it to a ChannelSet directly
In Flex AMFChannel is used mostly. Action Message Format
Methods
applySettings (),connect(),connectFailed(),connectSuccess(), connectTimeoutHandler()
disconnect(),disconnectFailed(),disconnectSuccess(),flexClientWaitHandler(), getMessageResponder(),internalConnect(),internalDisconnect(),internalSend(),logout()
send(),setCredentials()
Properties
authenticated,channelSets,connected,connectTimeout,endpoint,failoverURIs,protocol,
reconnecting,recordMessageSizes,recordMessageTimes,requestTimeout,uri

Q 15. Give the name of Collection which can be mapped to java and Flex and vice-versa
Ans: java.lang.String String
java.lang.Boolean, boolean Boolean
java.lang.Integer, int int
java.lang.Short, short int
java.lang.Byte, byte[] int
java.lang.Byte[] flash.utils.ByteArray
java.lang.Double, double Number
java.lang.Long, long Number
java.lang.Float, float Number
java.lang.Character, char String
java.lang.Character[], char[] String
java. math.BigInteger String
java.math.BigDecimal String
java.util.Calendar Date
java.util.Date Date
java.util.Collection mx.collections.ArrayCollection(for example, java.util.ArrayList)java.lang.Object[] Arrayjava.util.Map Object (untyped). For example, a java.util.Map[] is converted to an array (of objects).
java.util.Dictionary Object (untyped)
org.w3c.dom.Document XML object
java.lang.Object (other than previously listed types) Typed Object
Objects are serialized by using JavaBean introspection rules and also include public fields. Fields that are static, transient, or nonpublic, as well as bean properties that are nonpublic or static, are excluded.

Q 16. How can you call JavaScript from MXML
Ans: IExternalInterface.call()

Q 17. How can you access a var defined in 1 MXML flex in to another MXML file
Ans: Create 1 object of MXML fiel into another MXML File

Q 18. Is it possible to make httpService Requests synchronous?
Ansvar mytoken:AsyncToken = yourservice.send();
mytoken.addResponder(new ItemResponder(function,errorFunction));
OR
You can create a result handler to your HTTPService.
remoteObjectName.Your method
name.addEventListener("result",HandlerFunction,false,0,true);

Q 19. I need to load an image from flickr into my application. Do I need a crossdomain.xml file on flickr?
Ans: every SWF file you view runs locally on your machine. This means that a SWF would have HTTP access to all machines behind the company firewall. To prevent this, every server other than the one the SWF is loaded from, needs to have a crossdomain.xml file in its root, listing all domains that have access to that particular server

Q 20. What is the difference between httpService and Data Service?
Basically, 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.

Q 21. How do you generate random numbers within a given limit with actionscript?
Ans:var randNum:Number = Math.random()*100;

Q 22. Have you built any components with actionscript? If so explain how you did it?
Ans:
package myComponents{
import mx.controls.Button;
public class MyButton extends Button {
public function MyButton() {
super();
label="Submit";
}}}

Q 23. How do you implement push on a flex applications?
Ans
Messaging systems let separate applications communicate asynchronously as peers by passing packets of data called messages back and forth through a Message Service. A message usually consists of a header and a body. The header contains an identifier and routing information. The body contains application data.

So, you will be building an application that allows you to asynchronously send data through the DS message service to our Flex client application. Here are some key DS messaging terms:

Producer: Producers are applications that create/send messages to the destination.
Consumer: Consumers are applications that receive messages from the destination.
Message Destination: Destinations are the resources used for both publish-subscribe and point-to-point messaging.
Message Channel: The channel is the method for connecting producers and consumers to the destination (using an endpoint).
Message Endpoint: An endpoint is the interface responsible for encoding and decoding data into messages.
Message Adaptor: The adaptor defines the messaging implementation. Options include using the ActionScriptAdapter provided with DS, or an external Java Message Service (JMS) provider.

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

Q 25. What is a resource Manager??

Q 26. What are the similarities between java and flex?

Q 27. What is the dynamic keyword used for?

Q 28. How do you implement push with flex data services?

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

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

Q 31. Can you write to the file system from flex?

Q 32. What is a drag manager?
Ans: Manages the drag-and-drop operations; for example, its doDrag() method starts the drag operation.

Q 33. How do you call javascript from Flex?
Ans:flash.external.ExternalInterface.call(function_name: String[, arg1, ...]):Object;

Q 34. How do you use a repeater?
Ans:
< id="rp" dataprovider="{dp}">
< height="49" width="50" click="Alert.show(String (event.currentTarget.getRepeaterItem()) + ' pressed')" label="{String (rp.currentItem)}">
< /mx:repeater>

Q 35. What are three ways to skin a component in flex?
Ans: Graphical skins: Images that define the appearance of the skin. These images can JPEG, GIF, or PNG files, or they can be symbols embedded in SWF files. Typically you use drawing software such as Adobe® PhotoShop® or Adobe® Illustrator® to create graphical skins.
Programmatic skins: ActionScript or MXML classes that define a skin. To change the appearance of controls that use programmatic skins, you edit an ActionScript or MXML file. You can use a single class to define multiple skins.
Stateful skins: A type of programmatic skin that uses view states, where each view state corresponds to a state of the component.The definition of the view state controls the look of the skin. Since you can have multiple view states in a component, you can use a single component to define multiple skins.

Q 36. How do you use css styles in flex?
Ans: Using external style sheets, Using local style definitions, Using the StyleManager class ,Using the setStyle() and getStyle() methods, Using inline stylesLoading style sheets at run time.

Q 37. What is the difference between sealed class and dynamic classes?
Ans: Sealed Classes: ActionScript 3.0 introduces the concept of sealed classes. A sealed class possesses only the fixed set of properties and methods that were defined at compile time; additional properties and methods cannot be added. This enables stricter compile-time checking, resulting in more robust programs. It also improves memory usage by not requiring an internal hash table for each object instance. Dynamic classes are also possible using the dynamic keyword. All classes in ActionScript 3.0 are sealed by default, but can be declared to be dynamic with the dynamic keyword.
Dynamic classes A dynamic class defines an object that can be altered at run time by adding or changing properties and methods. 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.
dynamic class Protean
{ //Use dynamic keyword before the name of class
}

Q 38. What is e4X and XML?
Ans: E4X means "ECMAScript For XML
Using E4X, we can develop code with XML data faster than was possible with previous programming techniques. E4X provides a set of classes and functionality for working with XML data. ActionScript 3.0 includes the following E4X classes: XML, XMLList, QName, and Namespace.
Here is an example of manipulating data with E4X:
var myXML:XML =
<>
< id="'1'">
<>burger
<>3.95
< /item>
< id="'2'">
<>fries
<>1.45
< /item>
< /order>
trace (myXML.item[0].menuName); // Output: burger
trace (myXML.item.(@id==2).menuName); // Output: fries
trace (myXML.item.(menuName=="burger").price); // Output: 3.95

Q 39. What is state? What is the difference between states and ViewStack?
Ans:View Stack is to handle different MXML file eg TAB control, and states is the transition within single MXML file

Q 40. How does item renderer work? How do I add item renderer at runtime?

Q 41.. What keyword allows you to refer to private variables of a class?

Q 42. How polymorphism works on actionscript?

Q 43.. How do you overload functions in actionscript?

Q 44. What is dynamic keyword used for?
Ans: Those Classes which should be extended and changed are called Dynamic classes

Q 45. What are sealed classes?
Ans: Classes whichyou cant extend. ex String

Q 46. What are runtime shared libraries?

Q 47. What is caringhorm? How do you use it? Have you worked with Cairngorms?

Q 48. What keyword allows you to implement abstraction better?

Q 49. What design patterns have you used? In Actionscript and java?

Q 50. What's the difference between Java and AS3 getters and setters? Ans: I have to explicitly call a setter/getter function in Java, while AS3 allows me to Access my setters and getters as though they are variables.
Q 51. Explain the component lifecycle.
Q 52. Tell me about dataServices
Q 53. understanding of MVC
Q 54. They ask what frameworks you aree familiar with When getting developers to help create "standard" application, I'd weight a lot more heavily on the as3 questions. Aside from basic "show me how you'd write X" algorithm questions, you can ask more in depth ones about the workings of the language:
Q 55. Explain how binding works in mxml components.

Q 56. Explain the ChangeWatcher.Wach()
Ans: You can detect when a binding occurs in your application. Flex includes the mx.binding.utils.ChangeWatcher class that you can use to define a watcher for a data binding. Typically, your event watcher invokes an event listener when the binding occurs

Q 57. Why would you want to keep a reference to a ChangeWatcher and call unwatch()?
Q 58. How do you add event listeners in mxml components. Now AS3 components?
Q 59. What does calling preventDefault() on an event do? How is this enforced?
Ans: Prevent defaults helps skipping the default behaviour or any componnent. Like in radio Button when you will click it will get selected, but if you want only the skin to be changed you can use preventDefault()

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

Q 61. I was interviewed for a Flex position. The hiring manager kept on asking Java and J2EE questions. So, I asked him politely: you are hiring me for a flex position, why do you keep on asking Java questions?
Q 62. What are some ways to specify styles on components?

Q 63. What is the problem with calling setStyle()
Ans: When you are instantiating an object and setting the styles for the first time, you should try to apply style sheets rather than use the setStyle() method because it is computationally expensive. This method should only be used when you are changing an object's styles during run time
Q 64. Explain the difference between creating an effect and setting the target as opposed to adding an effectListener
Q 65. What do repeater components do?
Q 66. How do you identify a component created in a repeater?

Q 67. What is state? What is the difference between states and ViewStack? Ans: View Stack is to handle different MXML file eg TAB control.And states is the transition within single MXML file ViewStack should be used where there is complete change in the controls used and States should be used when you just want to add or remove afew components based on certain conditions. Login/Registration/Forgot password is the best example for using States as each page will either add or remove to the already existing one.

Q 68. What is the difference between httpService and Data Service? Ans. The Flex presentation layer communicates with the business layer by using Flex data services, which are objects you insert in a Flex file. Specifically, you can use Flex data services to interact with the following:
* Web services
* HTTP services
* Remote objects
A Flex data service is an object you insert in an MXML file to communicate with the business layer of a multi-tier application. You use data services to send and receive data from web services, HTTP URLs, and remote objects such as server-based Java objects. An HTTP service is nothing more than an HTTP request to a URL. The primary purpose of HTTP services is to retrieve XML data from an external source.

Q 69. Why you don’t Embed all images in your application
Ans: That increases the size of the SWF File

Q 70. What type of images can be loaded
Ans: (PNG, GIF, JPEG, SWF at run time and PNG, GIF, JPEG, SWF, SVG at compile time)

Q 71. Explain ContainerCreationPolicy
Ans: This is used with the containers like Accordian, ViewStack etc. depending upon the ContainerCreationPolicy you have set accordingly the child pages will be loaded.
ALL Immediately create all descendants.
AUTO: Delay creating some or all descendants until they are needed.
NONE: Do not create any children.
QUEUED: Add the container to a creation queue.

Q 72. What are the factory classes
Ans: Factory class The factory class creates an object of the instance class to perform the effect on the target. You create a factory class instance in your application, and configure it with the necessary properties to control the effect, such as the zoom size or effect duration.

Q 73. Explain Metadata
Ans: You insert metadata tags into your MXML and ActionScript files to provide information to the Adobe Flex compiler. Metadata tags do not get compiled into executable code, but provide information to control how portions of your code get compiled.

Q 74. I was asked too many questions on the event bubbling, Like how to capture and event if the component is disabled.
Ans: addEventListner on the parents and enable the component in that handler

Q 75. obj.addEventListener(MouseEvent.CLICK, MouseClickHAndler); in this obj should inherit which class?
Ans: DispachEvent
You can manually dispatch events using a component instance's dispatchEvent() method. All components that extend UIComponent have this method
objectInstance.dispatchEvent(event:Event):Boolean

Q 76.Why we extent Sprite Class in our Graphical Classes?

Q 77.What is Layout Manager and explain the Properties and Methods?
AnsThe LayoutManager is the engine behind Flex's measurement and layout strategy. Layout is performed in three phases; commit, measurement, and layout.
The commit phase begins with a call to validateProperties(), which walks through a list (sorted by nesting level) of objects calling each object's validateProperties()method.

The objects in the list are processed by nesting order, with the most deeply nested object accessed first. This can also be referred to as bottom-up inside-out ordering.

The measurement phase begins with a call to validateSize(), which walks through a list (sorted by nesting level) of objects calling each object's validateSize() method to determine if the object has changed in size.

The layout phase begins with a call to the validateDisplayList() method, which walks through a list (reverse sorted by nesting level) of objects calling each object's validateDisplayList() method to request the object to size and position all components contained within it (i.e. its children).

Property of LayoutManager
usePhasedInstantiation : Boolean

A flag that indicates whether the LayoutManager allows screen updates between phases.

Q 78.How do you call a method in particular ItemRenderer. Also the ItemRenderer is your own Custom Component.
Ans
<>
< id="comboBox" dataprovider="{statesXMLList}" labelfield="@name" itemrenderer="ComboBoxItemRenderer">
< /mx:Application>
View ComboBoxItemRenderer.mxml
< ?xml version="1.0" encoding="utf-8"?>

< mx="http://www.adobe.com/2006/mxml" stylename="plain">
< text="{data.@name}" onclick="MyOwnMethodThatIWantToCall()">
< /mx:VBox>

Q 79.How can you implement Singleton in Flex Application?
Ans:If you are a Java Programmer dont be mistaken by saying create Private Constructor. We cant create private Constructor in Flex.

Q 80.Give similiarities btw Java and Flex
Ans: Both are object Oriented, Encapsulation, Inheritance, Abstraction and Polymorphism are implemeted in both of the technologies.
*The package like imports
*Availability of Classes in the scripting language
*Capabilities Arrays & ArrayCollections
*On the UI end, similarities to SWING

Flex Technical Interview Questions

Flex Technical Interview Questions

Is it possible to make httpService Requests synchronous?

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

What is the difference between httpService and Data Service?

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

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

How do you implement push on a flex applications?

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

What is a resource Manager??

What are the similarities between java and flex

What is the dynamic keyword used for?

How do you implement push with flex data services?

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

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

Can you write to the file system from flex?

What is a drag manager?

How do you call javascript from Flex?

How do you use a repeater?

What are three ways to skin a component in flex?

How do you use css styles in flex?

What is the difference between sealed class and dynamic classes?

What is MVC and how do you relate it to flex apps?

What is state? what is the difference between states and ViewStack?

How does item renderer work? How do I add item renderer at runtime?

What keyword allows you to refer to private variables of a class?

How polymorphism works on actionscript?

How do you overload functions in action script?

What is dynamic keyword used for?

What are sealed classes ?

What are runtime shared libraries?

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

What keyword allows you to implement abstraction better?

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

What's the difference between Java and AS3 getters and setters?

Explain how binding works in mxml components.

What's the difference between ChangeWatcher.watch, and BindingUtils.bindProperty?

Why would you want to keep a reference to a ChangeWatcher and call unwatch()?

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

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

Explain the lifecycle of a Cairngorm action.

What is the problem with calling setStyle()

Explain the difference between creating an effect and setting the target as opposed to adding an effectListener

How do you identify a component created in a repeater?

Rich Internet Applications With Adobe Flex and Java

Rich Internet Applications With Adobe Flex and Java MaheswaraRao This useful for Java guys those who want to learn Flex which is emerging now a days...

Top Flex Interview Questions

  • s it possible to make httpService Requests synchronous?
      http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=2&postId=7184

      Other Solution:

        I use a single HTTPService instance, and a single result handler. The send() method returns an AsyncToken, which is a dynamic object to which you add most any kind of property you want. The result handler function can access this AsyncToken and read those proerties. I typically set a “callId”, which is a string that identifies the call, and sometimes a “nextaction” property when I invoke a dataservice call. In the result handler, I use a switch statement to conditionally work with those properties to determine the next appropriate processing step, which obviously can include another dataservice call. The switch statement can get pretty long, but is easy to understand, debug and modify. With a single breakpoint, I can monitor every result.

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

      NO, file is already there we need to register IP address to flicker’s crossdomain.xml.

      A cross-domain policy file is an XML file that provides a way for the server to indicate that its data and documents are available to SWF files served from other domains. Any SWF file that is served from a domain that the server’s policy file specifies is permitted to access data or assets from that server. When a Flash document attempts to access data from another domain, Flash
      Player attempts to load a policy file from that domain. If the domain of the Flash document that is attempting to access the data is included in the policy file, the data is automatically accessible. The default policy file is named crossdomain.xml and resides at the root directory of the server that is serving the data. The following example policy file permits access to Flash
      documents that originate from foo.com, friendOfFoo.com, *.foo.com and 105.216.0.40:

      crossdomain.xml

                 

      If you want to access Flickr from Flex/Flash, you have to use Flickr API. And to use their API, you have to register with Flickr. While registering, they will ask you where you are going to host your application that will use the API. There you need to mention the URL/domain name of your website and they will add the website to their list of allowed domains in
      their crossdomain.xml

  • How to create application which fetches images from flickr using a keyword?

      What is the difference between httpService and DataService?

      Data Services :

      services-config.xml configuration file is required at compile time if the flex application is using FDS.

      A Flex data service is an object you insert in an MXML file to communicate with the business layer of a multi-tier application. Specifically, you can use Flex data services to interact with the following RPC Services:

      • Web services :

        • use raw HTTP requests
        • use named services or raw URLs and connect to an HTTP proxy using text-based query parameters or XML
      • HTTP services :

        • use the SOAP protocol
        • use named services or raw URLs and connect to an HTTP proxy using text-based query parameters or XML
      • Remote objects :

        • uses AMF3
        • example: server-based Java objects.
        • specifies named or unnamed sources and connects to an Action Message Format (AMF) gateway.
        • data is transferred in a binary format.
        • data move across the network more quickly.
        • data deserialized more rapidly than text-based formats such as XML.
        • performance gains, particularly where large sets of data are involved.
        • 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.
  • What is the difference between “mx.rpc.http.HTTPService” and “mx.rpc.http.mxml.HTTPService”
    • mx.rpc.http.HTTPService

Flex Generic Interview Questions

Flex Generic Interview Questions

What is Flex? Adobe Flex?
What kind of applications you can create from Flex?
What is the output of Flex applications?
What development environment you need to create Flex applications?
Can you manipulate images using Flex programs?
Does Flex support creating workflow based applications?
What kind of data grids you can create through Flex applications?
How do you connect to a database via a Flex program?
What kind of source code integration tools are available with Flex?
What third party development tools are available to program in Flex?
Can you develop web based applications in Flex?
Is Flex OS specific or operating system independent?
Can we run Flex applications in MAC?
Do we need any plugins to run Flex applications?

Flex Technical Interview Questions:
Source from : http://grou.ps/flex/talks/13594

Is it possible to make httpService Requests synchronous?
I need to load an image from flickr into my application. Do I need a crossdomain.xml file on flickr?
What is the difference between httpService and Data Service?
How do you generate random numbers within a given limit with actionscript?
Have you built any components with actionscript? If so explain how you did it?
How do you implement push on a flex applications?
I am going to add images into a tag. How will it resize itself?
What is a resource Manager??
What are the similarities between java and flex
What is the dynamic keyword used for?
How do you implement push with flex data services?
What are the methods called when a UI component is intialized?
How do you implement drag and drop on components that do not support ondrag and ondrop?
Can you write to the file system from flex?
What is a drag manager?
How do you call javascript from Flex?
How do you use a repeater?
What are three ways to skin a component in flex?
How do you use css styles in flex?
What is the difference between sealed class and dynamic classes?
What is MVC and how do you relate it to flex apps?
What is state? what is the difference between states and ViewStack?
How does item renderer work? How do I add item renderer at runtime?
What keyword allows you to refer to private variables of a class?
How polymorphism works on actionscript?
How do you overload functions in action script?
What is dynamic keyword used for?
What are sealed classes ?
What are runtime shared libraries?
What is caringhorm ? how do you use it? Have you worked with Cairnghorn?
What keyword allows you to implement abstraction better?
What design patterns have you used? in Actionscript and java?
What's the difference between Java and AS3 getters and setters?
Explain how binding works in mxml components.
What's the difference between ChangeWatcher.watch, and BindingUtils.bindProperty?
Why would you want to keep a reference to a ChangeWatcher and call unwatch()?
How do you add event listeners in mxml components. Now AS3 components?
What does calling preventDefault() on an event do? How is this enforced?
Explain the lifecycle of a Cairngorm action.
What is the problem with calling setStyle()
Explain the difference between creating an effect and setting the target as opposed to adding an effectListener
How do you identify a component created in a repeater?

Flex Interview

Flex Interview Questions Flex Interview Questions BL Pancholi

Flex Interview Questions

Flex Interview Questions Flex Interview Questions BL Pancholi

Related Flex Tutorials