Flex FAQ
Flex FAQ
Flex is a free, open source framework for building expressive web applications that deploy consistently on all major
browsers, desktops, and operating systems. It provides a modern, standards-based language and programming
model that supports common design patterns and a fast, enterprise-class client runtime based on ubiquitous Adobe®
Flash® Player software. Flex enables enterprises to create highly interactive, expressive applications that
dramatically enhance the user experience, increasing customer satisfaction and user productivity. Adobe offers a
professional Eclipse™ based IDE, Adobe Flash Builder™ software, plus advanced data services through the open
source BlazeDS project and commercial Adobe LiveCycle® Data Services software.
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 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 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()
<>{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 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 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 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 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 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";
}}}
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:
Q 24. I am going to add images into a tag. How will it resize itself?
Q 30. How do you implement drag and drop on components that do not support ondrag and ondrop?
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 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 47. What is caringhorm? How do you use it? Have you worked with Cairngorms?
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.ChangeWatcherclass 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 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 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 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
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"?>
A. The fastest, easiest way to get started is to use Flex Builder 3. Flex Builder 3 has an integrated set of
getting started capabilities that will guide you through your first Flex application. Alternatively, you can
download the Free Adobe® Flex™ 3 SDK, which includes the Flex framework, compilers and debuggers,
enabling you to develop Flex applications using an IDE of your choice.