Flex Interview Questions with Answer for Experienced Page 3
Flex Interview Questions with Answer for Experienced Page 3
Tags:
Flex ,
Flex Interview Questions
41. By using push( ) and pop( ) methods
42. 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.
43. 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.
44. 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.
45. 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.
46. Difference between Label and Text?
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(...)
Text:
Here the text is displayed in new lines.
47. 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
= "Ram Kishoore";
48. What is over loading? Is method over
loading possible in Flex?
No.
Method overloading is not supported in Action Script3.0.
49. 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
50. What is composition?
Making
use of the already created class functionality or behaviour by instantiating
the class and calling the required methods.
51. 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.
52. What is serialization?
Object
can be represented as sequence of bytes that includes the object's data as well
as information.
Transfer
of data from client to the server like sending the Java objects from Java to
Flex.
53. 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:
1) Spark components have been introduced. Component logic and appearance has
been separated. Appearance of the components is specified in skins.
2)
FXG
3)
FTE (Flash Text Engine)
4)
States changed
5)
Effects changed
54. 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.
55. Difference between Sealed Class and
Dynamic class?
Sealed
Class:
1.
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.
2.
This enables strict compile time checking.
3.
It also improves memory usage. Because it doesn’t require an internal hash
table for each object instance.
4.
All classes in Action Script 3.0 are sealed classes by default.
Dynamic
Class:
1.
A dynamic class defines an object that can be altered at run time by adding or
changing the properties and methods.
2.
It doesn’t enable strict compile time checking.
3.
It consumes more memory because it requires an internal hash table for each
object instance.
4.
You can create dynamic classes by using the dynamic attribute when you declare
a new class.
56. 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.
57. Explain about Modules?
Modules
are classes just like application files. You can create them either in
ActionScript or by extending a Flex class by using MXML tags. You can create
modules in MXML and in ActionScript. Modules are dynamically loadable SWF that
contains an IFlexModuleFactory class factory. They can be loaded if application
requires loading these module and they can be unloaded when application no
longer needs a module. These modules
cannot be run independently of an application.
An
MXML-based module file's root tag is <mx:Module>.
Creating
MXML-based modules
To
create a module in MXML, you extend the mx.modules.Module class by creating a
file whose root tag is <mx:Module>. In that tag, ensure that you add any
namespaces that are used in that module. You must also include an XML type
declaration tag at the beginning of the file:
<?xml
version="1.0"?>
After
you create a module, you compile it as if it were an application. After you
compile a module, you can load it into an application or another module.
Typically, you use one of the following techniques to load MXML-based modules:
• ModuleLoader -- The ModuleLoader class
provides the highest-level API for handling modules. For more information, see
Using the ModuleLoader class to load modules.
• ModuleManager -- The ModuleManager
class provides a lower-level API for handling modules than the ModuleLoader
class does. For more information, see Using the ModuleManager class to load
modules.
Ex:
Public
var mo:ModuleLoader =new ModuleLoader();
Mo.loadModule(“my.swf”);
Mo.unloadModule();
Creating
ActionScript-based modules
To
create a module in ActionScript, you can create a file that extends either the
mx.modules.Module class or the mx.modules.ModuleBase class.
Extending
the Module class is the same as using the <mx:Module> tag in an MXML
file. You should extend this class if your module interacts with the framework;
this typically means that it adds objects to the display list or otherwise interacts
with visible objects.
To
see an example of an ActionScript class that extends the Module class, create
an MXML file with the root tag of <mx:Module>. When you compile this
file, set the value of the keep-generated-actionscript compiler property to
true. The Flex compiler stores the generated ActionScript class in a directory
called generated. You will notice that this generated class contains code that
you probably will not understand. As a result, you should not write
ActionScript-based modules that extend the Module class; instead, you should
use MXML to write such modules.
If
your module does not include any framework code, you can create a class that
extends ModuleBase. If you use the ModuleBase class, your module will typically
be smaller than if you use a module based on the Module class because it does
not have any framework class dependencies.
The
following example creates a simple module that does not contain any framework
code and therefore extends the ModuleBase class:
//
modules/asmodules/SimpleModule.as
package
{
import
mx.modules.ModuleBase;
public
class SimpleModule extends ModuleBase {
public
function SimpleModule() {
trace("SimpleModule
created");
}
public
function computeAnswer(a:Number, b:Number):Number {
return
a + b;
}
}
}
To
call the computeAnswer() method on the ActionScript module
58. What is RSL (Runtime Shared Library)?
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:
1 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.
2 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.
3 Framework RSLs -- Precompiled
libraries of Flex components and framework classes that all applications can
share. Framework RSLs are precompiled for you.
59. How to call Java Script from Action
Script and Action Script from Java Script? (OR)
How do you call Java Script from flex and flex from Java Script?
From
Action Script you can directly call any JavaScript function on the HTML page,
passing any number of arguments of any data type, and receive a return value
from the call. Similarly, from JavaScript on the HTML page you can call an
Action Script function in Flash Player and get a return value.
Calling
Java script methods from Action script:
Syntax: ExternalInterface.call(
methodName:String, [parameter1:Object])
The
parameters have the following meanings:
MethodName:
The name of a JavaScript function to call
parameter1:
Any parameters to be passed to the function; you can specify zero or more
parameters, separating them by commas
Accessing
Flex from Java script:
You
can call Flex methods from your enclosing wrapper by using the ExternalInterface
API. You do this by adding a public method in your Flex application to a list
of callable methods. In your Flex application, you add a local Flex function to
the list by using the addCallback() method of the ExternalInterface API. This
method registers an Action Script method as callable from the JavaScript or
VBScript in the wrapper.
Syntax:
addCallback(function_name:String, closure:Function):void
The
function_name parameter is the name by which you call the Flex function from
your HTML page's scripts. The closure parameter is the local name of the
function that you want to call. This parameter can be a method on the
application or an object instance.
60. 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.
61. 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.
62. 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 transfer 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.
RUI,
flex benefits from halo skins, gradient fills, vector graphics and other flash
player features
63. Difference between view stack and view
states?
States
1.
This is used to change view of a single container itself.
2.
This should be used when you just want to add or remove a few components based
on certain conditions.
3.
Login/Registration/Forgot password is the best example for using the states as
each page will either add or remove to the already existing one.
View
Stack
1.
This is used to switch between different containers for a single view.
2.
This is used where there is a complete change in the controls used.
3.TabNavigator,
TabBar, LinkBar etc are the best examples.
<mx:states>
<mx:State
name="Register">
<mx:SetProperty
name="text" target="{l1}" value="Return to Login"
/>
<mx:SetProperty
name="title" target="{p1}" value="Register" />
<mx:SetProperty
name="label" target="{b1}" value="Register" />
<mx:AddChild
relativeTo="{fo1}" position="lastChild">
<mx:FormItem
label="Confirm">
<mx:TextInput/>
</mx:FormItem>
</mx:AddChild>
<mx:SetEventHandler
target="{l1}" name="click"
handler="currentState=''"/>
</mx:State>
64. What are the differences between Flex 3.0
and Flex 4.0?
Flex
3 used the Eclipse framework but had some integration issues. These are cleared
up in FB4.
FB4
introduces the Spark framework for enhancing the user inteface, and even comes
with some nice templates and many more online...build your application first,
then skin it with free pre-made skins, or some very professional ones at a
reasonable price.
You
no longer need flexbuilder as flashbuilder can be used to create projects using
either the flex 3 sdk (flashplayer 9) or
the flex 4 sdk (flashplayer 10).
Another Ans:
Flex 3
|
Flex 4 Flash Builder 4
|
|
SDK Code Name
|
Moxie
|
Gumbo
|
Compiler
|
Poor performance than Flex4 compiler
|
Iimproved compiler performance upto 25% more.
|
Packages available
|
com
flash mx adobe |
com
flash mx spark flashX |
Flash Player
|
Some features of flash player 10 are not supported.i.e
Graphical
|
Supports all features of flash player 10
|
States
|
Complexto use states syntax diffcult to use
|
States are now easier to use with simplified syntax
|
Namespace URI
|
http://www.adobe.com/2006/mxml
|
http://ns.adobe.com/mxml/2009
Library http://ns.adobe.com/flex/spark http://ns.adobe.com/flex/halo |
Components
|
Halo Components
|
Supports both Halo and Spark Components
|
Components Skinning Enhancements
|
Design and behaviour of component is included inside and
integrated.
|
Design and behaviour is clearily separated to create a smooth
workflow among designing and development.
|
Text engine
|
NA
|
New text engine supports
Bidirectional text, vertical text and over 30 writing systems including Arabic, Hebrew, Chinese, Japanese, Korean etc. Standard keyboard and mouse gestures for editing. New text classes (RichText, SimpleText, etc) |
FXG Support
|
NA
|
FXG is a declarative graphics format, it enables portability
of assets between tools. Assets created in Catalyst or CS4 Illustrator can be
used without modifying.
|
Layout Model
|
NA
|
Layout containers like HBox and Vbox are not required. Instead
Group class can be used to accomplish the purpose.
|
Adobe Catalyst
|
Adobe Catalyst not supported
|
Support and integration with Adobe Catalyst which is Adobe's
new designer tool for creating rich Internet application assets without need
of writing code.
|
Get Updates
Subscribe to our e-mail to receive updates.
Related Articles
Subscribe to:
Post Comments (Atom)
0 Responses to “Flex Interview Questions with Answer for Experienced Page 3”
Post a Comment
Thanks for your comments