Search the Web for JAVA Answers:

Search the Web for more JAVA Answers:
Hint: Press Ctrl+ to increase the font size of this blog and Ctrl- to decrease the font size of this blog.

Adobe Flex Answers

Adobe Flex is a software development kit released by Adobe Systems for the development and deployment of cross-platform rich Internet applications based on the Adobe Flash platform. Flex applications can be written using the Adobe Flash Builder or by using the freely available Flex compiler from Adobe.

Click Here for Flex 3 LiveDocs.



Q1. What is MXML and ActionScript?
We use two languages to write Flex applications: MXML and ActionScript. 

MXML:
MXML is an XML markup language that you use to lay out user interface components. Components are implicitly initialized when the user runs the application.
The Application class is a container Components are added to an application as children objects. MXML is compiled to ActionScript 3.0

ActionScript 3.0:
ActionScript is an ECMAScript-compliant object-oriented programming language that is primarily used for application logic. Components are created and added to the display though an explicit call to the addControls() function when the user runs the application.

You need to add an initialize listener to the application object to call the function that adds the components (initialize="addControls()"). You need to explicitly attach the components to application object (this.addChild(photo))
----------------------------------------------------
Q 2.
 Life cycle of Flex Application.




Ans: Preinitialize: The application has been instantiated but has not yet created any child components.
Initialize: The application has created child components but has not yet laid out those components.
creationComplete: The application has been completely instantiated and has laid out all components
ApplicationComplete: Dispatched after the Application has been initialzed (When Applicable)
-------------------------------------------------------
Q3. Types of controls in Flex.
Ans: Controls are user-interface components such as Button, TextArea, and ComboBox controls. Adobe Flex has two types of controls:
-Basic Controls: Button control, PopUpButton control, ButtonBar and ToggleButtonBar controls, LinkBar control
TabBar control, CheckBox control, RadioButton control.
-Data Driven ControlsList control, HorizontalList control, TileList control, ComboBox control, DataGrid control, Tree control.
-------------------------------------------------------
Q4. What is the Base Container in Flex?
mx:Application


-------------------------------------------------------
Q5. Event Propagation Flow LifeCycle.
There are three phases in event propagation where Flex looks for event listeners:
 1. Capturing phase: Flex checks to see which ancestors are registered as listeners for the event starting from the root application object to the direct ancestor of the target.
·     2. Targeting phase: Flex invokes the target's event listeners
·     3. Bubbling phase: Each registered listener is given a chance to handle the event starting from the direct ancestor of the target to the root application object.


Q6. What are some properties of events?
 -event.target: The target property refers to the dispatcher of the event.
 -event.currentTarget: The currentTarget property refers to the current object that is processing the event
 -eventType: Type of event broadcast by the object when an event occurs and what is being listened for by the event handler
-event listener: The function or class method that you write to respond to specific events. They're also known as event handlers.
----------------------------------------------------
Q7. What are different ways to create an event?
-Creating a subclass from the Event class.
-Using the Event metadata tag to make the event public so that MXML compiler recognizes it.

-Dispatching an event using dispatchEvent().
----------------------------------------------------
Q8. Component LifeCycle in Flex.
Three phases:
- Birth: Construct, Configuration, Attach, Initialization
-Life: Invalidation, Validation
-Death: Detachment
----------------------------------------------------
Q9. What are Flex Formatters?
Adobe Flex formatters are components that you use to format data into strings. Formatters perform a one-way conversion of raw data to a formatted string. You typically trigger a formatter just before displaying data in a text field. Flex includes standard formatters that let you format currency, dates, numbers, phone numbers, and ZIP codes.

All Flex formatters are subclasses of the mx.formatters.Formatter class. The Formatter class declares a format() method that takes a value and returns a String value.

For most formatters, when an error occurs, an empty string is returned and a string describing the error is written to the formatter'serror property. The error property is inherited from the Formatter class.

The following steps describe the general process for using a formatter:
-Declare a formatter in your MXML code, specifying the appropriate formatting properties.
-Call the formatter's format() method within the curly braces ({ }) syntax for binding data, and specify the value to be formatted as a parameter to the format() method.
----------------------------------------------------
Q10. What are Flex Validators?
The data that a user enters in a user interface might or might not be appropriate to the application. In Flex, you use a validator to ensure the values in the fields of an object meet certain criteria. For example, you can use a validator to ensure that a user enters a valid phone number value, to ensure that a String value is longer than a set minimum length, or ensure that a ZIP code field contains the correct number of digits.

In typical client-server environments, data validation occurs on the server after data is submitted to it from the client. One advantage of using Flex validators is that they execute on the client, which lets you validate input data before transmitting it to the server. By using Flex validators, you eliminate the need to transmit data to and receive error messages back from the server, which improves the overall responsiveness of your application.
Note: 
Flex validators do not eliminate the need to perform data validation on the server, but provide a mechanism for improving performance by performing some data validation on the client.
----------------------------------------------------
Q11. Name some common Flex validators.


-Validating credit card numbers
-Validating currency
-Validating dates
-Validating e-mail addresses
-Validating numbers
-Validating phone numbers
-Validating using regular expressions
-Validating social security numbers
-Validating strings
-Validating ZIP codes

----------------------------------------------------
Q12. What are Styles and Themes?
You can modify the appearance of Flex components through style properties. These properties can define the size of a font used in a Label control, or the background color used in the Tree control. In Flex, some styles are inherited by children from their parent containers, and across style types and classes. In addition, you can override individual properties for each control at a local, component, or global level, giving you great flexibility in controlling the appearance of your applications.

A theme defines the look and feel of a Flex application. A theme can define something as simple as the color scheme or common font for an application, or it can be a complete reskinning of all the components used by the application. Themes usually take the form of a SWC file. However, themes can also be a CSS file and embedded graphical resources, such as symbols from a SWF file.
--------------------------------------------------
Q13. Differentiate View State and View Stack.

Difference between states and ViewStack in flex:
* View Stack is to handle different MXML files (eg TAB control) while States is the transition within single MXML file. 
ViewStack should be used were there is complete change in the controls used and States should be used when you just want to add or remove a few components based on certain conditions. ViewStates are virtual state of an existing page apearing at an instance i.e. only one state can be shown at a time while viewStack are collection of different view containers which can be shown at a time.
--------------------------------------------------
Q14. Explain a DataModel.

A data model is an object you can use to temporarily store data in memory so that you can more easily manipulate the data. For example, a data model could store information such as a person's name, age, and phone number, as follows:


mx:Model id="myEmployee"
name first>JohnDoeAccountingjdoe@goodcompany.com
The fields of a data model can contain static data as above, or they can be bound to other objects. This binding allows you to pass data to and from the data model.
--------------------------------------------------
Q15. How to create webservices?



--------------------------------------------------
Q16. What is a Runtime Shared Library (RSL)?
One way to reduce the size of your applications' SWF files is by externalizing shared assets into stand-alone files that can be separately downloaded and cached on the client. These shared assets can be loaded and used by any number of applications at run time, but must be transferred only once to the client. These shared files are known as Runtime Shared Libraries or RSLs.
If you have multiple applications but those applications share a core set of components or classes, clients can download those assets only once as an RSL rather than once for each application. The RSLs are persisted on the client disk so that they do not need to be transferred across the network a second time. The resulting file size for the applications can be reduced. The benefits increase as the number of applications that use the RSL increases.

Flex applications support the following types of RSLs:
Standard RSLs -- A library of custom classes created by you to use across applications that are in the same domain. Standard RSLs are stored in the browser's cache.
Cross-domain RSLs -- A library of custom classes, like standard RSLs, with the difference being that they can be loaded by applications in different domains and sub-domains. Cross-domain RSLs are stored in the browser's cache.
Framework RSLs -- Precompiled libraries of Flex components and framework classes that all applications can share. Framework RSLs are precompiled for you.
-------------------------------------------------
Q17. What are Modular Based Applications in Flex?
Modules are SWF files that can be loaded and unloaded by an application. They cannot be run independently of an application, but any number of applications can share the modules.

Modules let you split your application into several pieces, or modules. The main application, or shell, can dynamically load other modules that it requires, when it needs them. It does not have to load all modules when it starts, nor does it have to load any modules if the user does not interact with them. When the application no longer needs a module, it can unload the module to free up memory and resources.

Modular applications have the following benefits:
-Smaller initial download size of the SWF file.
-Shorter load time due to smaller SWF file size.
-Better encapsulation of related aspects of an application. For example, a "reporting" feature can be separated into a module that you can then work on independently.
--------------------------------------------------
Q18. What are Shared objects?
Shared objects are like browser cookies however:
-They do not expire by default.
-By default, they are limited to a size of 100 KB each.
-They can store simple data types (such as String, Array, and Date).
-They are stored in a location specified by the application (within the user's home directory).
-They are never transmitted between the client and server.
-Use getLocal() to create a shared object. (SharedObject.getLocal("myTasks"); )
-Use flush() to write the shared object to the client file. (sharedObj.flush())
-Use clear() to destroy a shared object (sharedObj.clear())

--------------------------------------------------
Q19. What is Flex AIR?
The Adobe AIR runtime lets developers use Adobe Flex technology to build rich Internet applications (RIAs) that deploy to the desktop. AIR applications run across operating systems and are easily delivered using a single installer file. With AIR, Flex developers can use their existing skills, tools, and code to build highly engaging, visually rich applications that combine the power of local resources and data with the reach of the web.
Benefits of Adobe AIR for developers using Flex include:
-Use your existing skills, tools, and code to build engaging desktop applications that complement and expand your web-based applications.
-Take advantage of the desktop capabilities in Adobe AIR to build applications that are more responsive, engaging, and valuable for users.
-Connect local desktop resources and data with web technologies to bridge the gap between the desktop and the web.
-Deliver the same behavior on the desktop as in the browser. AIR applications built with Flex use the high-performance, cross-operating system virtual machine from Adobe Flash Player 9 software.
-Feel more confident about the reliability and stability of your AIR applications knowing that they use proven, open technologies such as Tamarin, WebKit, and SQLite.
--------------------------------------------------
Q20. What is the difference between Flex 2.0 and Flex 3.0?


Ans: The main updates to Flex 3 are:
1. Advanced DataGrid and Data Visualization Profiler.
2. Support for HTTPService.
3. WTC Capabilities.

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

Q21. How to upload or download a file in Flex?
The FileReference class lets you add the ability to upload and download files between a client and a server. Users are prompted to select a file to upload or a location for download from a dialog box.

Each FileReference object that you create with ActionScript refers to a single file on the user's hard disk. The object has properties that contain information about the file's size, type, name, creation date, and modification date.
-------------------------------------------------
Q22. Differentiate between RemoteObjects v/s HTTPService.

-------------------------------------------------
Q23. What is RMI?


-------------------------------------------------Q24. What is the Drag and Drop Component in Flex?
Drag and drop 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.

The drag-and-drop operation has three main stages: initiation, dragging, and dropping:

Initiation:
User initiates a drag-and-drop operation by using the mouse to select a Flex component, or an item in a Flex component, and then moving the component or item while holding down the mouse button. For example, a user selects an item in a List control with the mouse and, while holding down the mouse button, moves the mouse several pixels. The selected component, the List control in this example, is the drag initiator. 

Dragging :
While still holding down the mouse button, the user moves the mouse around the Flex application. Flex displays an image during the drag, called the drag proxy. A drag source object (an object of type DragSource) contains the data being dragged. 

Dropping:
When the user moves the drag proxy over another Flex component, that component becomes a possible drop target. The drop target inspects the drag source object to determine whether the data is in a format that the target accepts and, if so, allows the user to drop the data onto it. If the drop target determines that the data is not in an acceptable format, the drop target disallows the drop. 
A drag-and-drop operation either copies or moves data from the drag initiator to the drop target. Upon a successful drop, Flex adds the data to the drop target and, optionally, deletes it from the drag initiator in the case of a move.

The following figure shows one List control functioning as the drag initiator and a second List control functioning as the drop target. In this example, you use drag and drop to move the 'Television' list item from the drag initiator to the drop target:
Drag and drop between two List controls
A single Flex component can function as both the drag initiator and the drop target. This lets you move the data within the component. The following example shows a List control functioning as both the drag initiator and the drop target:
Drag and drop in the same List control
By specifying the List control as both the drag initiator and the drop target, you can use drag and drop to rearrange the items in the control. For example, if you use a Canvas container as the drag initiator and the drop target, you can then use drag and drop to move controls in the Canvas container to rearrange them.
-----------------------------------------------------
Q25. What is ItemRenderer?

Think of the data provider as the model, and the Flex components (DataGrid,HorizontalList,List,Menu, MenuBar,TileList,Tree) as the view of the model. By separating the model from the view, we can change one without changing the other. Each list control has a default mechanism for controlling the display of data, or view, and lets you override that default. To override the default view, you create a custom item renderer.

In addition to controlling the display of data using an item renderer, the DataGrid, List, and Tree controls let users edit the data. For example, you could let users update the Quantity column of a DataGrid control if you are using it for a shopping cart. As with the display of data, the list controls have a default mechanism for letting users edit data that you can override by creating a custom item editor.
-----------------------------------------------------
Q26. What is ItemEditor?
Please refer to the answer above.
-----------------------------------------------------
Q27. Explain the Cairngorm Framework.
Click for a detailed explanation of the Flex Cairngorm Framework.
-----------------------------------------------------
Q 28. Types of Binding in Flex:
Ans: Data binding is the process of tying the data in one object to another object. It provides a convenient way to pass data between the different layers of the application. 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 three ways to specify data binding: the curly braces ({}) syntax in MXML, the mx:Binding tag in MXML, and the BindingUtils methods in ActionScript.
------------------------------------------------------- 
Q 29. How to create your own event?
Ans:
-Creating a subclass from the Event class.
-Using the Event metadata tag to make the event public so that MXML compiler recognizes it.
-Dispatching an event using dispatchEvent().
-------------------------------------------------------
Q 30. What is Event Bubbling?
Ans:The mechanism through which event objects are passed from the objects that generates an event up through the containership hierarchy.
------------------------------------------------------- 
Q 31. How you implement MVC in your Application? What is the Cairngorm framework?
Ans: Cairngorm is based on the MVC model. It is specifically designed to facilitate complex state and data synchronization between the client and the server, while keeping the programming of the View layer detached from the data implementation.

The role of the View layer in a Cairngorm application is to throw events and bind to data stored in the Model. Components on the View can bind to Value Objects or other properties in the Model (data) layer.
In a Cairngorm Model, related data are stored in Value Objects (VOs), while simple variables can be stored as direct properties of the ModelLocator class. A static reference to the ModelLocator singleton instance is used by the View layers to locate the required data.

The Controller is the most sophisticated part of the Cairngorm architecture. The Controller layer is implemented as a singleton FrontController. The FrontController instance, which receives every View-generated event, dispatches the events to the assigned Command class based on the event's declared type.
The Command class then processes the event by running the Command class' execute() method, which is an ICommand interface method. The event object may include additional data if required by the developer. The execute() method can update the central Model, as well as invoke a Service class which typically involves communication with a remote server. The IResponder interface, which is also implemented by the Command class, includes onResult and onFault methods to handle responses returned from the invoked remote service.
-------------------------------------------------------
 
Q 32. Difference between Java and Flex Getters Setters?
Ans: When it comes to getters and setters, Java and ActionScript are quite different, in that getters and setters are part of the core ECMAScript language, whereas in Java, getters and setters are done through a naming convention.
In Java, it is almost never a good idea to make member variables public. If you do decide to make member variables public and then later want to change the interface to use getter/setter functions, you will have to modify all callers of your interfaces, which is onerous at best and in many cases, not possible.
Meanwhile, in ECMAScript, the externally visible interface doesn’t change when we go from a member variable to a getter/setter and back again. In some sense, interface hiding is already accomplished in the language. Creating public member variables is “safe” in this sense.
------------------------------------------------------
Q 33. How many events are fired when your focus goes in one text box, you enter some text and then press tab.
Ans: PreinitializeHandler(), initializeHandler(), itemEditBegin, itemEditEnd, creationComplete()
-------------------------------------------------------
 
Q 34. What are the different ways of using Style sheets?
Ans: Using external style sheets, Using local style definitions, Using the StyleManager class ,Using the setStyle() and getStyle() methods, Using inline stylesLoading style sheets at run time
-------------------------------------------------------
Q 35. How can you use two Styles at the same time?
Ans: Using external style sheets and use Inline style commands.
-------------------------------------------------------
 
Q 36. Try to remember properties of few imp components.
Ans:
< id="WeatherService" wsdl="http:/example.com/ws/WeatherService?wsdl" useproxy="false">
< !-- Bind the value of the ZIP code entered in the TextInput control to the ZipCode parameter of the GetWeather operation. -->
< name="GetWeather">
<>{zip.text}
< /mx:request>
< /mx:operation>
------------------------------------------------------- 
Q 37. How will you call Java method from Flex?
Ans: Using RemoteObject. Explain the process to interviewer
-------------------------------------------------------
 
Q 38. 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 39. What are the channels and their types?
Ans: The Channel class is the base message channel class that all channels in the messaging system must extend.
Channels are specific protocol-based conduits for messages sent between MessageAgents and remote destinations. Preconfigured channels are obtained within the framework using the ServerConfig.getChannel() method. You can create a Channel directly using the new operator and add it to a ChannelSet directly
In Flex AMFChannel is used mostly. Action Message Format
Methods
applySettings (),connect(),connectFailed(),connectSuccess(), connectTimeoutHandler()
disconnect(),disconnectFailed(),disconnectSuccess(),flexClientWaitHandler(), getMessageResponder(),internalConnect(),internalDisconnect(),internalSend(),logout()
send(),setCredentials()
Properties
authenticated,channelSets,connected,connectTimeout,endpoint,failoverURIs,protocol,
reconnecting,recordMessageSizes,recordMessageTimes,requestTimeout,uri
-------------------------------------------------------
 
Q 40. 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 41. How can you call JavaScript from MXML
Ans: IExternalInterface.call()
-------------------------------------------------------
 
Q 42. How can you access a var defined in one MXML flex in to another MXML file?
Ans: Create one object of MXML fiel into another MXML File.
-------------------------------------------------------
 
Q 43. Is it possible to make httpService Requests synchronous?
Ansvar mytoken:AsyncToken = yourservice.send();
mytoken.addResponder(new ItemResponder(function,errorFunction));
OR
You can create a result handler to your HTTPService.
remoteObjectName.Your method
name.addEventListener("result",HandlerFunction,false,0,true);
-------------------------------------------------------
 
Q 44. 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 45. What is the difference between httpService and Data Service?
Ans: Flex allows three types of RPC services: HttpService, WebServices, and RemoteObject Services. In Flex, using the “RemoteObjects specifies named or unnamed sources and connects to an Action Message Format (AMF) gateway, whereas using the HTTPService and WebService use named services or raw URLs and connect to an HTTP proxy using text-based query parameters or XML”. Specifically, HTTPServices use raw HTTP requests, WebServices use the SOAP protocol and RemoteObjects uses AMF3.
-------------------------------------------------------
Q 46. How do you generate random numbers within a given limit with actionscript?
Ans:var randNum:Number = Math.random()*100;
-------------------------------------------------------

Q 47. Have you built any components with actionscript? If so explain how you did it?
Ans:
package myComponents{
import mx.controls.Button;
public class MyButton extends Button {
public function MyButton() {
super();
label="Submit";
}}}
-------------------------------------------------------
Q 48. How do you implement push on a flex applications?
Ans: Messaging systems lets separate applications communicate asynchronously as peers by passing packets of data called messages back and forth through a Message Service. A message usually consists of a header and a body. The header contains an identifier and routing information. The body contains application data.
So, you will be building an application that allows you to asynchronously send data through the DS message service to our Flex client application. Here are some key DS messaging terms:
Producer: Producers are applications that create/send messages to the destination.
Consumer: Consumers are applications that receive messages from the destination.
Message Destination: Destinations are the resources used for both publish-subscribe and point-to-point messaging.
Message Channel: The channel is the method for connecting producers and consumers to the destination (using an endpoint).
Message Endpoint: An endpoint is the interface responsible for encoding and decoding data into messages.
Message Adaptor: The adaptor defines the messaging implementation. Options include using the ActionScriptAdapter provided with DS, or an external Java Message Service (JMS) provider.
-------------------------------------------------------
Q 49. What is a drag manager?
Ans: Manages the drag-and-drop operations; for example, its doDrag() method starts the drag operation.
-------------------------------------------------------
 
Q 50. How do you call javascript from Flex?
Ans:flash.external.ExternalInterface.call(function_name: String[, arg1, ...]):Object;
-------------------------------------------------------
 
Q 51. How do you use a repeater?
Ans:
< id="rp" dataprovider="{dp}">
< height="49" width="50" click="Alert.show(String (event.currentTarget.getRepeaterItem()) + ' pressed')" label="{String (rp.currentItem)}">
< /mx:repeater>
-------------------------------------------------------
Q 52. What are three ways to skin a component in flex?
Ans: Graphical skins: Images that define the appearance of the skin. These images can JPEG, GIF, or PNG files, or they can be symbols embedded in SWF files. Typically you use drawing software such as Adobe PhotoShop or Adobe Illustrator to create graphical skins.
Programmatic skins: ActionScript or MXML classes that define a skin. To change the appearance of controls that use programmatic skins, you edit an ActionScript or MXML file. You can use a single class to define multiple skins.
Stateful skins: A type of programmatic skin that uses view states, where each view state corresponds to a state of the component.The definition of the view state controls the look of the skin. Since you can have multiple view states in a component, you can use a single component to define multiple skins.
-------------------------------------------------------
Q 53. 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 54. What is e4X and XML?
Ans: E4X means "ECMAScript For XML".
Using E4X, we can develop code with XML data faster than was possible with previous programming techniques. E4X provides a set of classes and functionality for working with XML data. ActionScript 3.0 includes the following E4X classes: XML, XMLList, QName, and Namespace.
-------------------------------------------------------
Q 55. 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 56. Why you don’t Embed all images in your application
Ans: That increases the size of the SWF File
-------------------------------------------------------
Q 57. What type of images can be loaded
Ans: (PNG, GIF, JPEG, SWF at run time and PNG, GIF, JPEG, SWF, SVG at compile time)
-------------------------------------------------------
Q 58. Explain ContainerCreationPolicy
Ans: This is used with the containers like Accordian, ViewStack etc. depending upon the ContainerCreationPolicy you have set accordingly the child pages will be loaded.
ALL Immediately create all descendants.
AUTO: Delay creating some or all descendants until they are needed.
NONE: Do not create any children.
QUEUED: Add the container to a creation queue.
-------------------------------------------------------
 
Q 59. What are the factory classes
Ans: The factory class creates an object of the instance class to perform the effect on the target. You create a factory class instance in your application, and configure it with the necessary properties to control the effect, such as the zoom size or effect duration.
-------------------------------------------------------
Q 60. Explain Metadata.
Ans: You insert metadata tags into your MXML and ActionScript files to provide information to the Adobe Flex compiler. Metadata tags do not get compiled into executable code, but provide information to control how portions of your code get compiled.
-------------------------------------------------------
Q 6`1.What is Layout Manager and explain the Properties and Methods?
AnsThe LayoutManager is the engine behind Flex's measurement and layout strategy. Layout is performed in three phases; commit, measurement, and layout.
The commit phase begins with a call to validateProperties(), which walks through a list (sorted by nesting level) of objects calling each object's validateProperties()method.
The objects in the list are processed by nesting order, with the most deeply nested object accessed first. This can also be referred to as bottom-up inside-out ordering.
The measurement phase begins with a call to validateSize(), which walks through a list (sorted by nesting level) of objects calling each object's validateSize() method to determine if the object has changed in size.
The layout phase begins with a call to the validateDisplayList() method, which walks through a list (reverse sorted by nesting level) of objects calling each object's validateDisplayList() method to request the object to size and position all components contained within it (i.e. its children).
Property of LayoutManager
usePhasedInstantiation : Boolean 

A flag that indicates whether the LayoutManager allows screen updates between phases.
-------------------------------------------------------
Q 62.How do you call a method in particular ItemRenderer. Also the ItemRenderer is your own Custom Component.
Ans
<>
< id="comboBox" dataprovider="{statesXMLList}" labelfield="@name" itemrenderer="ComboBoxItemRenderer">
< /mx:Application>
View ComboBoxItemRenderer.mxml
< ?xml version="1.0" encoding="utf-8"?>
< mx="http://www.adobe.com/2006/mxml" stylename="plain">
< text="{data.@name}" onclick="MyOwnMethodThatIWantToCall()">
< /mx:VBox>
-----------------------------------------------------
Q 63.Give similiarities btw Java and Flex
Ans: Both are object Oriented, Encapsulation, Inheritance, Abstraction and Polymorphism are implemeted in both of the technologies.
*The package like imports
*Availability of Classes in the scripting language
*Capabilities Arrays & ArrayCollections
*On the UI end, similarities to SWING
-----------------------------------------------------
Q 64. What do repeater components do?
Use the tag to declare a Repeater component that handles repetition of one or more user interface components based on dynamic or static data arrays at run time. The repeated components can be controls or containers. Using a Repeater component requires data binding to allow for run-time-specific values.