Top 50 Adobe Flex Interview Questions You Must Prepare 27.Jul.2024

Q1. 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.

Q2. Difference Between Array And Array Collection?

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

Q3. How To Add Two Commands To One Single Event Type?

Sequence Command is used to add multiple commands to one event type.

Q4. Difference Between Data Grid And Advanced Data Grid?

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

Q5. 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.

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

Yes.

Q7. Difference Between Item Renderer And Item Editors?

Both are used for editing,but item renderer is used for displaying visual elements..

  • 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.
  • itemrenderer is used to format and display the contents in a components whereas itemeditor allows us to edit the displayed content

Q8. What Is Serialization?

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

Q9. Tell Me Arguments Of Addeventlistener() Method?

addEventListener (type: string, listener: function, useCapture: Boolean=false, priority:int=0, useWeakReference:Boolean=false):void

  • type: Type of Event(MouseClick, MouseOver)
  • listener: It’s a function
  • useCapture(dfault:false): If True: Enable only Capturing Phase
  • Flase: Enable Targetting and Bubbling Phase.
  • Priority(int=0): The priority level of the listener. The higher the number the higher the priority. 
  • 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.

Q10. 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.

Q11. 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:

  • Global: styles applied to all the components.
  • Type selector: Applied to particular type of components in entire project.
  • Style Name selector: Applied to only one component by specifying the Style Name property.

Q12. What Are All The Events Dispatched In Item Editor?

Item Edit Beginning, Item Edit Begin, Item Edit End

Q13. 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:

  1. To set the components measuredWidth, measuredHeight, measuredMinWidth and measuredMinHeight.
  2. To set the default width and height values to this component.
  3. To measure the child components widths and Heights. So that we can specify how much width and height is required for our component.
  4. Measure method is called only when you are not specifying both width and height externally at the time of calling this component.
  5. This method can be called multiple times by calling the invalidateSize() method.

Q14. 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.

Q15. 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:

  1. Curly braces ({ }) syntax in mxml and [Bindable] metadata tag
  2. <mx: Binding> tag in MXML
  3. BindingUtils.bindProperty/bindSetter methods in Action Script at runtime.

Q16. 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.

Q17. 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.

Q18. 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
  • 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.
  • 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.)
  • Front Controller: Receives Cairngorm Events and maps them to Cairngorm Commands.
  • Command: Handles business logic, calls Cairngorm Delegates and/or other Commands, and updates the Value Objects and variables stored in the Model Locator
  • Delegate: Created by a Command, they instantiate remote procedure calls (HTTP, Web Services, etc) and hand the results back to that Command.
  • Service: Defines the remote procedure calls (HTTP, Web Services, etc) to connect to remote data stores.

Q19. Explain The Configuration Details Of Blaze Ds?

  1. Add BlazeDS JAR files and dependent JAR files to the WEB-INF/lib directory from BlazeDS project.
  2. Add BlazeDS configuration files in the WEB-INF/flex directory from BlazeDS project.
  3. 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. 

Q20. 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

Q21. What Are The Collections Classes Available In Flex?

Array Collection, XML List Collection, Grouping Collection.

Q22. 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.

Q23. 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 trfers 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

  • http: this is a protocol used to communicate with webserver from client. http me “Hyper Text Trfer Protocol”
  • localhost: Host name of the machine where you have deployed your Java web project.
  • 8080: Port number of the web server where you have deployed your Java project.
  • JavaTest: Context root of the web application to identify the web project uniquely.
  • Messagebroker/amf: this is the URL pattern of the servlet which we have defined in web.xml file.
  • <<protocol>>://<<hostname>>:<<port no>>/<<context root>>/<<URL Pattern>>

Q24. 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.

Q25. What Is Over Loading? Is Method Over Loading Possible In Flex?

No. Method overloading is not supported in Action Script3.0.

Q26. What Is Composition?

Making use of the already created class functionality or behaviour by instantiating the class and calling the required methods.

Q27. How To Display The Check Box In Data Grid Header?

<mx:DataGridColumn headerText="ADD" dataField="add"     itemRenderer="mx.controls.Button"/>
            <itemrendere>
            </itemRenderer>

Q28. 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:

  • BIRTH:Construction, configuration, attachment, initialization
  • LIFE :  Invalidation, validation, interaction
  • 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);
            }

Q29. Difference Between Sealed Class And Dynamic Class?

Sealed Class:                        

  • 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.                              
  • This enables strict compile time checking.
  • It also improves memory usage. Because it doesn’t require an internal hash table for each object instance.
  • All classes in Action Script 3.0 are sealed classes by default.                    

 Dynamic Class:

  • A dynamic class defines an object that can be altered at run time by adding or changing the properties and methods.
  • It doesn’t enable strict compile time checking.
  • It consumes more memory because it requires an internal hash table for each object instance.
  • You can create dynamic classes by using the dynamic attribute when you declare a new class.

Q30. 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.

Q31. 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.

  1. 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.
  2. 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 tritions. We can apply various changes to a same component in various states. They will appear according to states.

Q32. 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.

Q33. Difference Between Swc And Swf File?

  • SWC file is a library file and SWF file is a runnable file. We will copy to Flex Projects libs folder.
  •  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.

Q34. 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.

Q35. 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:

  1. HTTP Service
  2. Webservice
  3. 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. 

Q36. Advantages Of Adobe Flex?

  1. Complete browser portability: any browser that supports flash player and that includes almost every browser.
  2. Strong backend connectivity: from its inception, flex has featured excellent support for popular backend technologies such as the java and dot Net.
  3. Streaming: flex offers excellent support for streaming binary data. Heavy allocations that needs to trfer large amount of data to the end user.
  4. Asynchronous: Asynchronous request/response model. Flex offers complete support for asynchronous processing of user requests.
  5. 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.
  6.  Security and Rich User Interfaces: Robust security flex leverages the highly tested flash player security.
  7. RUI, flex benefits from halo skins, gradient fills, vector graphics and other flash player features

Q37. 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.

Q38. 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.

Q39. Explain About Different Types Of Channels Available In Blaze Ds?

 HTTP Channel, AMF Channel, RTMP Channel:

  • AMF Channel: A simple channel endpoint that trport data over HTTP in the binary AMF format in an asynchronous call and response model.
  • HTTP Channel: Provides the sample behaviour the AMF Channel/endpoint, but trport data in AMFX format, which is the text based representation of AMF.
  • 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.

Q40. 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.

Q41. 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.

  • In flash no coding only designing.
  • In flex you can create big projects.

Q42. 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";

Q43. 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:

  1. (Optional) Create a subclassfrom the flash.events.Eventclass to create an event class that describes the event object. 
  2. (Optional) Use the [Event]metadata tag to make the event public so that the MXML compiler recognizes it. 
  3. Dispatch the event using the dispatchEvent() method. 

Q44. What Is Stoppropagation() And Stopimmediatepropagation()? (or) Difference Between Stoppropagation And Stopimmediatepropagation()? (or) How To Stop The Event Flow/ Event Phases?

  • 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). 
  • 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.

Q45. 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.

Q46. 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 {}

  1. 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.
  2. 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”.

Q47. 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

  1. what all is in our swf, and
  2. who depended on each class to cause it to be included.

Q48. 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).

Q49. 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.

Q50. 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:

  • Spark components have been introduced. Component logic and appearance has been separated. Appearance of the components is specified in skins.
  • FXG
  • FTE (Flash Text Engine)
  • States changed
  • Effects changed