Pages

Showing posts with label flex interview questions for freshers. Show all posts
Showing posts with label flex interview questions for freshers. Show all posts

50 [Latest] Adobe Flex job Interview Questions with Answers pdf

Adobe Flex Interview Questions and Answers for freshers and experienced

•    What Is The Use Of Disableautoupdate Method?
This method prevents the events that represent changes to the underlying data from being broadcasted by the view. It also prevents collection from being updated. This method is useful where multiple items in collection are being edited at once. By disabling the auto update the changes are received as a batch instead of multiple events. Also in a DataGrid this method prevents update to the collection while a specific item is selected. When item is no longer selected the DataGrid controls calls enableAutoUpdate() method.

•    What Events Are Used By The Collections?
 Collections dispatch CollectionEvent, PropertyChangeEvent and FlexEvent objects.
o    Collections dispatch a CollectionEvent when there is a change in collection. The property kind for a CollectionEvent object can be used to find which kind of change occurred. This property is compared against CollectionEventKind constants to find what the change was for example, UPDATE etc.
o    The CollectionEvent object includes an items property that is an array of objects. For ADD and REMOVE kind events this contains added or removed items, but for UPDATE it contains an array of PropertyChangeEvent objects.
o    PropertyChangeEvent class has kind property to indicate the way in which property changed. This can be determined by comparing kind property with PropertyChangeEventKind constants, for example UPDATE. This event object also has properties to indicate the values before and after the change.
o    View cursor objects dispatch a FlexEvent with type property mx.events.FlexEvent.CURSOR_UPDATE when the cursor position changes.
Adobe Flex interview questions and answers for freshers and experienced pdf

•    What Is A View Cursor?
A cursor is a position indicator; it points to a particular item in the collection. We use view cursor to traverse items in a collection’s data view and modify the data in collection.
 A view cursor includes following methods:
1.    The moveNext() and movePrevious() to move the cursor forward or backward. Use beforeFirst or afterLast properties to check whether we have reached the bounds.
2.    The findAny(), findFirst() and findLast() methods move the cursor to an item that matches the parameter.

•    What Is A Filter Function?
We use this function to limit the data view in the collection to a subset of source data object. The function must take a single Object parameter, which corresponds to a collection item, and must return a Boolean value specifying whether to include the item in the view.

•    What Is A Metadata Tag?
These tags provide information to Flex compiler regarding the usage of our component. Examples are Bindable, Event, DefaultProperty, Inspectable etc.

•    Does Exclude Or Exclude Class Really Excludes The Data Or Class?
Exclude(and ExcludeClass) tags simply influence the set of choices that are available in Flex Builder. They don’t exclude the classes from linking, which is a general misconception. There are MXML options to say “I want to treat this symbol as exteranally defined” . Depending on how we compile our application, generally the classes that are included are those that are referenced from the root application or classes, either directly or via some other class that is referenced directly or not from the root application or classes. The -link-report mxmlc option is very useful in that it tells us
0.    what all is in our swf, and
1.    who depended on each class to cause it to be included.

•    What Is The Difference Between Viewstack Vs Viewstate?
Actually ViewStack and ViewState are not related. View states give one way to change the look and feel of a component in response to user action. We can also use navigation container e.g. Acordion, ViewStack, Tab navigator etc. Choice of selecting navigation container or states depends upon requirement of application.
0.    View stack is a component used to display different views (normally different data), one at a time. View states are related views of a single set of data. For example normal view and advanced view for a image.
1.    In ViewStack components can not be shared easily between the different views, they had to be created each time view is changed. For example if we want a search box in every view, then it has to be created in every view. States work with transitions. We can apply various changes to a same component in various states. They will appear according to states.

•    What Are The Differences Between Flex 3 And Flex 4?
There can be lot of syntactic or other differences between the two, but major difference is: In Flex 4 the architecture of components (most of) have got changed. These components (called Spark the older ones in Flex 3 are called Halo) have separated the role of developer and designer. Spark components have one main core component class (written in actionscript) that contains the main logical part and one Skin class that handles all the visual aspects. We can say core component is skeleton and skin is its visual appearance. For example spark button has one core Button class and one skin class for it.

•    What Are The Advantages And Disadvantages Of Using Flex? And Why Flex Wins Over Other Technologies?
Flex is very mature component-based development framework that reduces the development time and gives very good results. There are plenty of advantages: Easy to learn, Flash Player available widely, Works really well with other back-end technologies (specially with java), based on components so very easy to debug and fix, also has a very good IDE etc. The disadvantages are: applications used to be slightly heavy etc. But all of them can be handled to a good extent by following up best-practices and good application architecture.

•    What Is Flex?
Flex is an application framework (yes it is a framework!!) that allows developers to build rich applications for desktop (using AIR), web, mobiles and tablets (iOS, android, blackberry etc). The web applications (SWF Files) run in Flash Player which is available in more than 90% computers across the world. For desktop-based applications AIR is needed. There are two main building blocks for development in Flex: ActionScript (used mainly for Logic part) and MXML (used mainly for declaration of tags and components etc).

•    Explain Data Binding In Flex?
Data binding is the process by which changes in one action script object are reflected in another action script object. (OR) Data binding automatically copies the value of a property of a source object to a property of a destination object when the source property changes.
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. An object dispatches the triggering event when the source property changes
Adobe Flex provides 3 ways to specify Data binding:
0.    Curly braces ({ }) syntax in mxml and [Bindable] metadata tag
1.    <mx: Binding> tag in MXML
2.    BindingUtils.bindProperty/bindSetter methods in Action Script at runtime.

•    Explain The Configuration Details Of Blaze Ds?
0.    Add BlazeDS JAR files and dependent JAR files to the WEB-INF/lib directory from BlazeDS project.
1.    Add BlazeDS configuration files in the WEB-INF/flex directory from BlazeDS project.
2.    Define Message Broker Servlet and a session listener in WEB-INF/web.xml from BlazeDS project.
The Blaze DS uses four main configuration files namely:
    Services-config.xml: The top level Blaze Ds configuration file, this file usually contains security constraints, channel definitions and logging settings that each of the services can use.
    Remoting-config.xml: The remoting service configuration file, which defines remoting service destinations for working with remote objects.
    Proxy-config.xml : The proxy service configuration file which defines proxy service destinations for working with webservices and HTTP Service (REST Services)                   
    Messaging-config.xml: The messaging service configuration file, which defines messaging service destinations for performing publish subscribe messaging.

•    Explain About Blaze Ds And Blaze Ds Services?
BlazeDS provides a set of services that lets you connect a client-side application to server-side data, and pass data among multiple clients connected to the server. BlazeDS implements real-time messaging between clients.
Blaze DS services:
0.    HTTP Service
1.    Webservice
2.    Remote Object
            HTTP Service: HTTP Service components to interact with JSP’s, Servlets and ASP Pages that are not available as Webservice or remoting services destinations.
            <mx:HTTPService id=”myService” url=”http://localhost:8400/middlejava/LoginServlet” result=”resultHandler(event)” fault=faultHandler(event)” method=”Get”/>
            Webservice: Webservice components let you access webservices, which are software modules with methods. Webservices methods are commonly referred to as operations. Webservice interfaces are defined by using XML. Flex application can interact with webservices that define their interfaces in a Webservices Description Language (WSDL) document, which is available as a URL. WSDL is a standard format for describing the messages that a webservice understands the format of these responses to those messages.
            <mx: WebService id=”Webservice” wsdl=”http://search.yahoo.com/searchservice?wsdl” result=”resultHandler (event)” fault=faultHandler (event)” method=”Get”/>
            Remote Object: Remote object components let us access the methods of server side java objects, without manually configuring the objects as webservices. We can use remote object components in MXML or ActionScript. We can use RemoteObject components with a standard alone BLAZE DS web application or macromedia ColdFusion MX from Adobe.

•    Difference Between Cairngorm Event And Flex Event?
o    Cairngorm Event is not a bubbled event and it can be understand by only flex commands.
o    Flex events can be dispatched by every component in Flex.

•    How To Add Two Commands To One Single Event Type?
Sequence Command is used to add multiple commands to one event type.

•    Should Model Locator As A Singleton Class? Can't We Instantiate This Class As Like Normal Class?
You can call as a normal class because constructor is public.

•    What Is Singleton Class? Explain The Steps To Create A Singleton Class?
The singleton pattern is a design pattern that is used to restrict instantiation of a class to one object. If we create the class as a singleton then no way to create more than one instance. But, we can get that single instance in any number of classes. So all the classes will share the same properties and behaviours of that singleton object.
Steps to create a Singleton class:
Consider the MySingleTon class as a singleton class.
            package {
                        public class MySingleTon {
                                    // Single Instance of Our MySingleTon
                                    private static var instance:MySingleTon;
                                    //DEFINE YOUR VARIABLES HERE
                                    public function MySingleTon (enforcer:SingletonEnforcer)
                                    {
                                                if (enforcer == null)
                                                {
                                                             throw new Error( "You Can Only Have One MySingleTon");
                                    }
                                    }
                                    // Returns the Single Instance
                                    public static function getInstance() : MySingleTon
                                    {
                                      if (instance == null)
                                      {
                                                                         instance = new MySingleTon ( new SingletonEnforcer );
                                      }
                                      return instance;
                                    }
                       }
                          }
            // Utility Class to Deny Access to Constructor
            class SingletonEnforcer {}
0.    We should create one static variable. It will be called "instance" and it will be of type MySingleTon. This will be the variable where we will store our one instance of our class.
1.    Then we should create one constructor. The constructor takes one argument - "enforcer". You will notice that this "enforcer" has a type of "SingletonEnforcer" which is defined directly after our class. Here is the logic behind that:
    When you put a class in an ActionScript file below the main class, it is only available to that class.
    If the constructor requires this argument – then only our main class can create an instance of itself, because we do not have access to the “SingletonEnforcer” class. Only the main class has this access.
     We will not access our class in the normal way by using the “new” statement because we can’t call the constructor. Once we get inside of the constructor, we have a few lines that make sure things work as planned. The “if” statement ensures that we had a valid “enforcer” passed in. If there wasn’t it throws an Error stating that “You Can Have Only One MySingleTon”.

•    Explain About Cairngorm Architecture?
Cairngorm is an implementation of several design patterns that form a lightweight architectural framework. Cairngorm follows the principle of separating the view and business logic which is known as the Model-View-Controller pattern (MVC).
The Pieces of Cairngorm:

    Model Locator
    View
    Front Controller
    Command
    Delegate
    Service
o    Model Locator: Stores all of your application’s Value Objects (data) and shared variables, in one place. Similar to an HTTP Session object, except that its stored client side in the Flex interface instead of server side within a middle tier application server.
o    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, and generating custom Cairngorm Events based on user interaction (clicks, rollovers, drag n drop.)
o    Front Controller: Receives Cairngorm Events and maps them to Cairngorm Commands.
o    Command: Handles business logic, calls Cairngorm Delegates and/or other Commands, and updates the Value Objects and variables stored in the Model Locator
o    Delegate: Created by a Command, they instantiate remote procedure calls (HTTP, Web Services, etc) and hand the results back to that Command.
o    Service: Defines the remote procedure calls (HTTP, Web Services, etc) to connect to remote data stores.

•    Tell Me Arguments Of Addeventlistener() Method?
addEventListener (type: string, listener: function, useCapture: Boolean=false, priority:int=0, useWeakReference:Boolean=false):void
o    type: Type of Event(MouseClick, MouseOver)
o    listener: It’s a function
o    useCapture(dfault:false): If True: Enable only Capturing Phase
o    Flase: Enable Targetting and Bubbling Phase.
o    Priority(int=0): The priority level of the listener. The higher the number the higher the priority.
o    useWeakReference(default =false): whether the reference to the listener is strong or weak. A strong reference (default) preventing your listener from being garbage-collected, a weak reference does not.

•    What Is Clone() Method?
Clone method creates duplicate copy of the event class. This method is executed automatically when the event is redispatched in the event listeners.

•    What Is Preventdefault () Method?
To cancel the default behaviour of the event. The methods of the Event class can be used in event listener functions to affect the behaviour of the event object. Some events have an associated default behaviour. For example, the doubleClick event has an associated default behaviour that highlights the word under the mouse pointer at the time of the event. Your event listener can cancel this behaviour by calling the preventDefault () method.
PreventDefault () method will work only if Cancellable property is true, otherwise it’s not working.

•    What Is The Difference Between Target And Current Target?
Target: The object that dispatched the event (doesn’t change). Target will not change.
Current Target: The object who is currently being checked for specific event listeners (changes). Current target is keep on change.

•    How To Create Custom Events? Explain The Steps To Create A New Custom Event?
To dispatch a new event from your custom component, you must do the following:
0.    (Optional) Create a subclassfrom the flash.events.Eventclass to create an event class that describes the event object.
1.    (Optional) Use the [Event]metadata tag to make the event public so that the MXML compiler recognizes it.
2.    Dispatch the event using the dispatchEvent() method.

•    What Is Stoppropagation() And Stopimmediatepropagation()? (or) Difference Between Stoppropagation And Stopimmediatepropagation()? (or) How To Stop The Event Flow/ Event Phases?
o    stopPropagation: Prevents processing of any event listeners in nodes subsequent to the current node in the event flow. This method does not affect any event listeners in the current node (current target).
o    stopImmediatePropagation: Prevents processing of any event listeners in the current node and any subsequent nodes in the event flow. This method takes effect immediately and it affects event listeners in the current node.

•    What Is Adapter In Blaze Ds?
Java Adapter is used to communicate with Java and JMS adapter is used to communicate with JMS. Java adapter class allows us to invoke methods on a Java object.

•    Explain About Different Types Of Channels Available In Blaze Ds?
 HTTP Channel, AMF Channel, RTMP Channel:
o    AMF Channel: A simple channel endpoint that transport data over HTTP in the binary AMF format in an asynchronous call and response model.
o    HTTP Channel: Provides the sample behaviour the AMF Channel/endpoint, but transport data in AMFX format, which is the text based representation of AMF.
o    RTMP Channel: The RTMP Channel creates a single duplex socket connection to the server and gives the server the best notification of the player being shut down.

•    Explain About Remote Object? What Is End Point In Remote Object?
 Remote Object:  Remote Service automatically serializes and deserializes the data between Flex client and your server side language. As a result, you can directly call methods on your Java/.Net/ColdFusion/PHP etc… objects. This service connects to an AMF (Action Message Format) Gateway. AMF protocol transfers data in a binary format, so the data can be moved across the network more quickly.
endpoint: This property is used to identify the Java web project from your flex client project.
Ex: http://localhost:8080/JavaTest/messagebroker/amf
o    http: this is a protocol used to communicate with webserver from client. http means “Hyper Text Transfer Protocol”
o    localhost: Host name of the machine where you have deployed your Java web project.
o    8080: Port number of the web server where you have deployed your Java project.
o    JavaTest: Context root of the web application to identify the web project uniquely.
o    Messagebroker/amf: this is the URL pattern of the servlet which we have defined in web.xml file.
o    <<protocol>>://<<hostname>>:<<port no>>/<<context root>>/<<URL Pattern>>

•    Explain About Resultevent And Faultevent In Remote Object? (or) Explain About Result Handler And Fault Handler Methods?
o    result: This is the event listener for the event ResultEvent. This event is automatically dispatched by the Flash Player when it receives the successful results from the backend Java service.
o    fault: This is the event listener for the event FaultEvent. This event is automatically dispatched by the Flash Player when it receives any error in calling the Java method.

•    Difference Between Http Service And Remote Object? (or) Which One You Will Prefer?
Data Service(Remote Object):
o    Remote Objects specifies named or unnamed sources.  
o    This service connects to an AMF(Action Message Format) Gateway
o    AMF protocol transfers data in a binary format, so the data can be moved across the network more quickly.          
o    Remote Service automatically serializes and deserializes the data between Flex client and your server side language. As a result, you can directly call methods on your Java/.Net/ColdFusion/PHP etc… objects                 
HTTP Service/Web Service:
o    These services use named or raw URLs
o    These services connect to an HTTP Proxy Gateway.
    HTTP Service use HTTP protocol/requests
    Web Services use SOAP (Simple Object Access Protocol).
o    These services transfer data in XML format. This is slow.
o    Here the data transfer is in XML only.

•    Explain About Component Life Cycle?
A set of methods the framework calls to instantiate, control and destroy components. OR The component instantiation life cycle describes the sequence of steps that occur when you create a component object from a component class. As part of the life cycle, Flex automatically calls component methods, dispatches events, and makes the component visible.
3 Main Phases:
o    BIRTH:Construction, configuration, attachment, initialization
o    LIFE :  Invalidation, validation, interaction
o    DEATH : Detachment, garbage collection
override protected function createChildren():void{
                        myLab=new Label();
                        myLab.text="my label";
                        myLab.setStyle('color',"green");
                        this.addChild(myLab);
            }
override protected function updateDisplayList(unscaledWidth:Number,  unscaledHeight:Number):void {
                        myLab.move(0,0);
                        myLab.setActualSize(100,100);
            }
•    Explain About Measure() Method? When This Measure() Method Is Called?
The measure() method sets the default component size, in pixels, and optionally sets the component's default minimum size.
This method is used for following reasons:
0.    To set the components measuredWidth, measuredHeight, measuredMinWidth and measuredMinHeight.
1.    To set the default width and height values to this component.
2.    To measure the child components widths and Heights. So that we can specify how much width and height is required for our component.
3.    Measure method is called only when you are not specifying both width and height externally at the time of calling this component.
4.    This method can be called multiple times by calling the invalidateSize() method.

•    Difference Between Item Renderer And Item Editors?
Both are used for editing,but item renderer is used for displaying visual elements..
o    item editor is used for editing purpose. Item editor can pass data back from the particular control to save it as a new value for item being edited. We can also use item renderer as editor by using boolean property renderIsEditor.
o    itemrenderer is used to format and display the contents in a components whereas itemeditor allows us to edit the displayed content

•    How To Display The Check Box In Data Grid Header?
<mx:DataGridColumn headerText="ADD" dataField="add"     itemRenderer="mx.controls.Button"/>
            <itemrendere>
            </itemRenderer>

•    Can We Use Text Input/editable Component As Itemrenderer?
Yes.

•    What Are All The Events Dispatched In Item Editor?
Item Edit Beginning, Item Edit Begin, Item Edit End

•    What Are The Collections Classes Available In Flex?
Array Collection, XML List Collection, Grouping Collection.

•    Difference Between Array And Array Collection?
o    Array Collection is a wrapper class based on Array.
o    Array Collection contains sorting, filtering features but Array not.
o    Array Collection dispatches the Event when new item is added, updated or deleted.
o    Array Collection automatically refreshes/updates the view whenever the change happens in Array Collection.

•    What Type Of Skinning Is Available In Flex?
Graphical skinning, Programmatic Skinning and Stateful skinning:
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: Action Script or MXML classes that define a skin. To change the appearance of controls that use programmatic skins, you edit an Action Script or MXML file. You can use a single class to define multiple skins.
Sateful 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.

•    What Is The Difference Between Graphical Skinning And Stateful Skinning?
Sateful 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.

•    What Is Css (cascading Style Sheet)?
Cascading Style Sheets (CSS) are used in Flex to apply styles to visual components on the application display list. CSS is a standard for encapsulating the code that makes up the design of an Application. Given the power and maturity of CSS, most experienced Web designers/developers strive to implement as much of the design and layout properties of a Web site/application in CSS as possible. The result is much greater control and flexibility over the look and feel of the site.
Some features of CSS:
o    Global: styles applied to all the components.
o    Type selector: Applied to particular type of components in entire project.
o    Style Name selector: Applied to only one component by specifying the Style Name property.

•    Difference Between Swc And Swf File?
o    SWC file is a library file and SWF file is a runnable file. We will copy to Flex Projects libs folder.
o     SWC is what you use when you're looking for a library to compile into your app. You have access to the classes and can import individual parts. SWF is more likely what you're looking for when embedding graphics.

•    Difference Between Label And Text?
o     Label: If you explicitly size a label control so that it is not large enough to accommodate it's text the text is truncated and terminated by an ellipsis(...)
o    Text: Here the text is displayed in new lines.

•    What Is Shared Object? (or) How To Store The Data In Local?
 Shared objects function like browser cookies. The SharedObject class to store data on the user's local hard disk and call that data during the same session or in a later session. Applications can access only their own SharedObject data and only if they are running on the same domain. The data is not sent to the server and is not accessible by other Adobe® Flex® applications running on other domains, but can be made accessible by applications from the same domain.
            Public var so : SharedObject = SharedObject.getLocal("mySO");
            so.data.fName = "Wisdomjobs";

•    What Is Over Loading? Is Method Over Loading Possible In Flex?
No. Method overloading is not supported in Action Script3.0.

•    What Is Method Overriding?
Override a method of a base class in your ActionScript component. To override the method, you add a method with the same signature to your class, and prefix it with the override keyword

•    What Is Composition?
Making use of the already created class functionality or behaviour by instantiating the class and calling the required methods.

•    Difference Between String And String Buffer?
String is immutable and String Buffer is mutable. String class creates new instance for any method but String Buffer updates/modifies same instance.

•    What Is Serialization?
o    Object can be represented as sequence of bytes that includes the object's data as well as information.
o    Transfer of data from client to the server like sending the Java objects from Java to Flex.

•    What Are The Differences Between 4.6/4.5/4.0 And Flex 3.0?
 4.5 and 4.6 are used for developing mobile based applications. 4.6 has few new components.
4.0:
o    Spark components have been introduced. Component logic and appearance has been separated. Appearance of the components is specified in skins.
o    FXG
o    FTE (Flash Text Engine)
o    States changed
o    Effects changed

•    Difference Between Flash And Flex?
Flash is used by the designers. Flex is used by the developers. Flash uses only Flash Player API but Flex uses both Flash Player API and Flex SDK library also. like datavisualization.swc, automation.swc, rpc.swc.
o    In flash no coding only designing.
o    In flex you can create big projects.

•    Difference Between Sealed Class And Dynamic Class?
Sealed Class:                       
o    A sealed class possesses only fixed set of properties and methods that were defined at compile time. Additional properties and methods cannot be added at runtime.                             
o    This enables strict compile time checking.
o    It also improves memory usage. Because it doesn’t require an internal hash table for each object instance.
o    All classes in Action Script 3.0 are sealed classes by default.                   
 Dynamic Class:
o    A dynamic class defines an object that can be altered at run time by adding or changing the properties and methods.
o    It doesn’t enable strict compile time checking.
o    It consumes more memory because it requires an internal hash table for each object instance.
o    You can create dynamic classes by using the dynamic attribute when you declare a new class.

•    Difference Between Data Grid And Advanced Data Grid?
0.    Advance Data Grid allows sort by multiple column when you click in the column header. DataGrid allows only single column sort.
1.    Styling rows and columns: Use the style function property to specify a function to apply styles to rows and columns of the controls.
2.    Display Hierarchical and Grouped Data: Use an expandable navigation tree in a column to control the visible rows of the control.
3.    Creating Column Groups: Collect multiple columns under a single column heading.
4.    Using Item Renderers: Span multiple columns with an item renderer and use multiple item renderers in the same column.

•    Advantages Of Adobe Flex?
0.    Complete browser portability: any browser that supports flash player and that includes almost every browser.
1.    Strong backend connectivity: from its inception, flex has featured excellent support for popular backend technologies such as the java and dot Net.
2.    Streaming: flex offers excellent support for streaming binary data. Heavy allocations that needs to transfer large amount of data to the end user.
3.    Asynchronous: Asynchronous request/response model. Flex offers complete support for asynchronous processing of user requests.
4.    SVGs (Scalable Vector Graphics): flex stands out from most other RIA-based technologies because it supports vector-based drawing and direct embedding of SVG mark-up files. SVG based images look equally good at any resolution a given browser supports.
5.     Security and Rich User Interfaces: Robust security flex leverages the highly tested flash player security.
6.    RUI, flex benefits from halo skins, gradient fills, vector graphics and other flash player features

•    What Is Calllater () Method?
The callLater () method queues an operation to be performed for the next screen refresh, rather than in the current update. Without the callLater () method, you might try to access a property of a component that is not yet available.
Syn: callLater(method:Function, args:Array):void
Ex: We have a button click event that loads data from a XML file or a webservice. That loading of data would probably have another resultHandler which will wait for the loading to finish. And meanwhile your button click handler might be doing some other things …so in these situations we can use callLater.

•    What Is The Use Of Arraycollection Filter Function?
filterFunction: Function [read-write] : A function that the view will use to eliminate items that do not match the function criteria.
A filter function is expected to function (item: Object): Boolean When the return value is true if the specified item should remain in the view. If a filter is unsupported, flex throws as error when accessing this property. We must call refresh () method after setting the filter function property for the view to update.

Latest Adobe Flex Interview Questions and Answers pdf

40 Latest Adobe Flex Actionscript Interview Questions with Answers

1. What is a drag manager in adobe flex actionscript?
The Flex Drag and Drop Manager lets you select an object, such as an item in a List control, or a Flex control, such as an Image control, and then drag it over another component to add it to that component.

2. Explain What is the function of trace?
A. Initiate the automatic debugging procedure.
B. Discover who has downloaded your movie.
C. Send String Values to the output panel.
D. Determine what objects are presents on stage ant any one time.

3. What are the correct statements consenting text field?
A. Embedded font outlines are shared by text fields using the same font.
B. Font Outlines for static for static text field are embedded in the SWF file by default.
C. Font outline for input text field are embedded in SWF file by default.
D. Individual font outlines are embedded in to the SWF file for each text field in the FLA file.
E. Font outlines for dynamic text fields are embedded in SWF file by default.

4. Explain How many levels does Flash MX support?
A. 20
B. 80
C. 100
D. 1000

5. Explain What happens if an .swf is loaded into a already occupied level?
A. An error is thrown.
B. The new swf is rejected and the old one stays.
C. The old swf is unloaded and the new swf is loaded.
D. They share the same level

6. Explain What happens if an .swf is loaded into a already occupied level?
A. An error is thrown.
B. The new swf is rejected and the old one stays.
C. The old swf is unloaded and the new swf is loaded.
D. They share the same level

7. Explain Which of the following is the recommended character to use to separate target level paths levels?
A. / (slash)
B. $ (Dollar sign)
C. _ (underscore)
D. % (percentage sign)

8. What is default frame rate of the timeline in frame per second?
A. 1
B. 12
C. 24
D. 30

9. What Is Interface or Benefit of Interface in term of OOP?
► Allows you to specify a set of methods that
classes are required to implement

► Classes can implement multiple interfaces,
interfaces can extend each-other

► Interfaces can be seen as contracts to be
developed against, great for frameworks

10. What is Display container?
Display object container is special type of display object which can contain child display objects in addition to (generally) having its own visual representation. When a display object container is removed from the display list, all its children are removed as well.

Adobe Flex Actionscript Interview Questions with Answers

11. What is Display object?
Display object is an object which represents some type of visual content in Flash Player. Only display objects can be included in the display list, and all display object classes are subclasses of the DisplayObject class. After a display object is created, it won't appear on-screen until it is added into a display object container.

12. What is Display list?
Display list is hierarchy of display objects that will be rendered as visible screen content by Flash Player. The Stage is the root of the display list, and all the display objects that are attached to the Stage or one of its children form the display list (even if the object isn't actually rendered, for example if it's outside the boundaries of the Stage).

13. What Is the Model-View-Controller (MVC) Pattern?
The Model-View-Controller (MVC) is a compound pattern, or multiple patterns working together to create complexapplications.
► Model Contains the application data and logic to manage the state of the application
► View Presents the user interface and the state of the application onscreen
► Controller Handles user input to change the state of the application

14. What is Polymorphism in term of OOP (Flash Actionscript)?
Inheritance also allows you to take advantage of polymorphism in your code. Polymorphism is the ability to use a single method name for a method that behaves differently when applied to different data types.

15. What is Inheritance in term of OOP (Flash Actionscript)?
Inheritance is a form of code reuse that allows programmers to develop new classes that are based on existing classes. The existing classes are often referred to as base classes or superclasses, while the new classes are usually called subclasses. Advantage of inheritance is that it allows you to reuse code from a base class. Use the extends keyword to indicate that a class inherits from another class.

16. What is Interface in term of OOP (Flash Actionscript)?
An interface is a collection of method declarations that allows unrelated objects to communicate with one another. The structure of an interface definition is similar to that of a class definition, except that an interface can contain only methods with no method bodies. Interfaces cannot include variables or constants but can include getters and setters. To define an interface, use the interface keyword. Use the implements keyword in a class declaration to implement one or more interfaces.

17. What is different between URLLoader class and Loader class?
The URLLoader class downloads data from a URL as text, binary data, or URL-encoded variables. It is useful for downloading text files, XML, or other information to be used in a dynamic, data-driven application. A URLLoader object downloads all of the data from a URL before making it available to ActionScript. It sends out notifications about the progress of the download, which you can monitor through the bytesLoaded and bytesTotal properties, as well as through dispatched events.

The Loader class is used to load SWF files or image (JPG, PNG, or GIF) files. Use the load() method to initiate loading. The loaded display object is added as a child of the Loader object.

18. Tell some new capabilities / Features of Flash AS 3.0?
► URLLoader class to load text or binary data (The ActionScript 2.0 MovieClipLoader and LoadVars classes are not used in ActionScript 3.0. The Loader and URLLoader classes replace them.)

► Sound.computeSpectrum() (Takes a snapshot of the current sound wave and places it into the specified ByteArray object. It returns a ByteArray containing 512 normalized values (-1 to 1) that can be used to visually display the waveform of sound. 256 values for the left channel and 256 values for the right channel. These values can be use to create Sound Spectrum Analyzer displays in Audio Players like Winamp and Windows Media Playres.)

► BitmapData.getPixels() (Generates a byte array from a rectangular region of pixel data. Writes an unsigned integer (a 32-bit unmultiplied pixel value) for each pixel into the byte array. No need to loop through every pixel in a bitmap, one at a time with getPixel to send a bitmap to the server.)

► MovieClip.currentLabel (This returns the label of the current frame as a String. The current label in which the playhead is located in the timeline of the MovieClip instance. If the current frame has no label, currentLabel is set to the name of the previous frame that includes a label. If the current frame and previous frames do not include a label, currentLabel returns null.)

► stage.frameRate ( At runtime frame rate of stage can be change)

19. Can I embed HTML in my Flex application?
Flex supports a limited subset of HTML in its TextArea and some other text-related classes.

20. Why are the columns in my DataGrid in some strange order?
The order is typically the reverse of the order in which they were added. If you need a specific order, specify that and many other good things by using DataGridColumn tags.

21. When I have only a single record, why does not it appear in my DataGrid?
This is a known issue that is caused by the inability of Flex to differentiate between an object and an array with a single row. The solution is to always use toArray(), as in the following examples:
In MXML:
{mx.utils.ArrayUtil.toArray(modelAccidents1.accidents.accident)}
The inline format:
dataProvider={mx.utils.ArrayUtil.toArray(testSrv.result.result.error)}
In ActionScript:
myControl.dataProvider = mx.utils.ArrayUtil.toArray(testSrv.result.result.error)

22. What is the difference in MovieClip and Sprite?
Sprite does not have timeline in it But Movie Clips can have. Sprite is the parent class of MovieClip though not all of the MovieClip properties are available in the parent class.

23. I have i input text field on stage and I have a button also, Further i am writing some text in that input text field. I want to save my written data on my local system (on my computer), How can i do this?
To achieve this you have to use flash CS4 with Flash Player 10 or above. Using the new method of filereference class you can save you typed text on your computer as a text file.

First create a object of filereference… then use the save method and pass your data to it.
var fR:FileReference =new FileReference()
fR.save("your Written text should be come here.","flexflashforum.txt")

Paste the following code on frame and run a sample application...

Code:
var TxtF:TextField = new TextField();
var BtnMc:TextField = new TextField();
var MyFile:FileReference = new FileReference();

TxtF.border = true;
TxtF.type = TextFieldType.INPUT;

BtnMc.background = true;
BtnMc.backgroundColor = 0xCCCCCC;
BtnMc.x = 150;
BtnMc.height = 20;
BtnMc.text = " Click here to save";

24. How can you show a jpg image in Dynamic Text Field?
Using HTML Tags in HTML enabled text field you can load image in that. Make a Dynamic Text Field on Stage and give it instance name "txt", On frame paste the following code and test your flash.

Code:
txt.htmlText ="<img src='http://www.globalguideline.com/images/ggl.gif' width='139' height='139'> This image is under Dynamic text field of flash "

25. How do I make synchronous data calls in actionscript?
You cannot make synchronous calls. You must use the result event. No, you can't use a loop, setInterval, or even doLater. This paradigm is quite aggravating at first. Take a deep breath, surrender to the inevitable, resistance is futile.
There is a generic way to handle the asynchronous nature of data service calls, called ACT (Asynchronous Call Token). Search for this in the Developing Flex Applications LiveDocs for a full description.
Here it is in a nutshell. This example uses HTTPService but will be similar for RemoteObject and WebService:
1. Create a function to handle the data return, like onResult().
2. In the HTTPService tag, put this function name in the result property and pass "event" in too.
3. Invoke the call in the script:
//invokes the call to the HTTP data service
var oRequestCallbject = app.mxdsGetData.send(oRequest);
//Next, define a string to identify the call. We will use this string value in the result handler.

oRequestCall.MyQueryId = "WhateverIWanttoUseToIdentifyThisCall" ;
//Yes, you CAN set this AFTER you invoke send()
4. In the result handler, which will be called every time the data service call returns, identify what the returned data contains, as follows:
var callResponse = oEvent.call; //get the call object
//gets the value of this property you set in the call
var sQueryId = callResponse.MyQueryId; //will be "WhateverIWanttoUseToIdentifyThisCall";
trace(sQueryId);

26. How do I get Flex to query my database?
Flex does not have any native database integration functionality. You must have your own server-side tier that provides the database-access tier and sends the data back to Flex through one of the following protocols:
• RemoteObjects: This is the fastest. It communicates with server-side EJBs or POJOs using AMF, a binary compressed format.
• HTTPService: This one uses the HTTP protocol. Sources can be JSP, ASPx, .NET, or any URL that returns HTTP.
• WebService: This is the slowest. It uses the SOAP protocol. Sources can be .NET or any web service.

27. How do I run Flex as a service?
Flex is not a server that you deploy and run. It is simply deployed as part of your web application. So it will work, no matter which web container you are using: Tomcat, JRun 4, WebLogic, and so forth. To learn how to deploy Tomcat, JRun 4, or any other Java server as a service, refer to the appropriate documentation for the server you are using.

28. How do I pass parameters to a pop-up window in actionscript?
Three different ways to pass data into a title window.
It uses the initobj to pass in several built-in properties plus two user defined properties.
One is a simple string, the other is a reference to the main application that can be used for binding. Note the variable that holds the application reference is typed to the name of the application. this is critical for binding to work correctly.

29. Why are there errors with the macromedia.css.LocatorParser class and WebLogic?
WebLogic ships with its own version of the fop.jar, which in turn includes the batik.jar, which is older and breaks Flex. To resolve this issue, remove the fop.jar from the CLASSPATH in the startWebLogic.cmd file. This may apply to non-WebLogic servers as well, where batik.jar was included.

30. What is a resource Manager in flex actionscript?
The ResourceManager - now handles access to all localized resources in an application. Any components that extend UIComponent, Formatter, or Validator now have a new resourceManager property, which lets you easily access the singleton instance of this manager. If you're writing some other kind of class that needs to use the ResourceManager, you can call ResourceManager.getInstance() to get a reference to it.

31. What are the similarities between java and flex?
Both can be used as client application, both have packages, OOP based , support XML , import external packages, up casting, support ArrayCollection ,almost same primitive data types, both support class library packaging( .jar , .swc).

32. What design patterns have you used? in Actionscript and java?
1. Creational Pattern
* Factory Method Pattern
* Singleton Pattern

2. Structural Patterns
* Decorator Pattern
* Adapter Pattern
* Coposite Pattern

3. Behavioral Patterns
* Command Pattern
* Observer Pattern
* Template Metod Pattern
* State Pattern
* Strategy Pattern

4. Multiple Patterns
* MVC Pattern
* Symetric Proxy Pattern

33. Explain how binding works in mxml components in flex?
  Binding in MXML
Lets look at the following code…
<mx:TextInput id=”ti1?/>
<mx:Label id=”label1? text=”{ti1.text}”/>
Here you are binding the text property of the TextInput to the label. So whatever you type in the textInput automatically reflects in the label. That’s the power of Binding…

The best practice for defining components that return information back to the main application is to design the component to dispatch  an event that contains the return data. In that way, the main  application can define an event listener to handle the event and take the appropriate action. You also use events in data binding.
The following example uses the Bindable metadata tag to make useShortNames a bindable property. The implicit setter for the useShortNames property dispatches the change event that is used internally by the Flex framework to make data binding work.


34. What is the difference between ChangeWatcher.watch, and BindingUtils.bindProperty?
ChangeWatcher:
Acts like the watch on AS2. It watches a variable for changes and  when something happens fires an event. Make sure you call the  canWatch to ensure that you can watch it!
There are 3 ways to specify the second parameter, the chain.

1. A String containing the name of a public bindable property of the host object.
ChangeWatcher.watch(this, "myvar", handler)

2. An Object in the form: { name: property name, access: function (host) { return host[name] } }. The Object contains the name of a public bindable property, and a function which serves as a getter  for that property.
ChangeWatcher.watch(this, { name:"myvar", getter: function():String
{ return "something" }}, handler);

3. A non-empty Array containing any combination of the first two  options. This represents a chain of bindable properties accessible  from the host. For example, to watch the property host.a.b.c, call  the method as: watch(host, ["a","b","c"]
BindingUtils.bindProperty
Works pretty much the same way as the watch, but instead of having  to handle and event it allows you to immediately bind two properties one-way.
The first two parameters are for the the target, the second parameters are the triggers.
BindingUtils.bindProperty( this, "va1", this, "var2");

Note : Make sure you add the flex framework.swc to your project Library Path to have access to the mx.binding.util class.

35. Why would you want to keep a reference to a ChangeWatcher and call unwatch()?
So we can reattach the watcher again & We can change the source object (of changewatcher) by reset method.
The ChangeWatcher class defines utility methods that you can use with bindable Flex properties. These methods let you define an event handler that is executed whenever a bindable property is updated.

unwatch () method:
Detaches this ChangeWatcher instance, and its handler function, from the current host. You can use the reset() method to reattach the ChangeWatcher instance, or watch the same property or chain on a different host object.
public function unwatch():void

36. How do you add event listeners in mxml components. Now AS3 components?
* addEventListener(type:String, listener:Function,
useCapture:Boolean = false, priority:int = 0,
useWeakReference:Boolean = false):void
* removeEventListener(type:String, listener:Function,
useCapture:Boolean = false):void
* dispatchEvent(event:Event):Boolean
* hasEventListener(type:String):Boolean
* willTrigger(type:String):Boolean

37. What does calling preventDefault() on an event do? How is this enforced?
Cancels an event's default behavior if that behavior can be canceled.. For example, the doubleClick event has an associated default behavior that highlights the word under the mouse pointer at the time of the event. Your event listener can cancel this behavior by calling the preventDefault() method.
You can use the Event.cancelable property to check whether you can prevent the default behavior associated with a particular event. If the value of Event.cancelable is true, then preventDefault() can be used to cancel the event; otherwise, preventDefault() has no effect.
What is the problem with calling setStyle()
Adobe Flex Actionscript Interview Questions with Answers