Top 50 Adobe Flex Actionscript Interview Questions
Q1. What Is The Model-view-controller (mvc) Pattern?
The Model-View-Controller (MVC) is a compound sample, or a couple of patterns working collectively to create complexapplications.
Model Contains the software information and common sense to manipulate the country of the software
View Presents the user interface and the nation of the application onscreen
Controller Handles consumer input to trade the country of the software
Q2. Why Are There Errors With The Macromedia.Css.Locatorparser Class And Weblogic?
WebLogic ships with its own model of the fop.Jar, which in flip consists of the batik.Jar, that is older and breaks Flex. To clear up this trouble, do away with the fop.Jar from the CLASSPATH inside the startWebLogic.Cmd record. This may also practice to non-WebLogic servers as nicely, wherein batik.Jar become protected.
Q3. Explain What Happens If An .Swf Is Loaded Into A Already Occupied Level?
An errors is thrown.
The new swf is rejected and the vintage one stays.
The old swf is unloaded and the brand new swf is loaded.
They share the identical degree
Q4. What Is Different Between Urlloader Class And Loader Class?
The URLLoader class downloads records from a URL as textual content, binary statistics, or URL-encoded variables. It is useful for downloading textual content documents, XML, or other facts to be used in a dynamic, statistics-driven application. A URLLoader item downloads all of the records from a URL earlier than making it to be had to ActionScript. It sends out notifications about the development of the download, which you could display via the bytesLoaded and bytesTotal residences, as well as thru dispatched activities.
The Loader class is used to load SWF files or picture (JPG, PNG, or GIF) files. Use the load() method to initiate loading. The loaded display item is introduced as a child of the Loader object.
Q5. What Is The Difference In Movieclip And Sprite?
Sprite does not have timeline in it But Movie Clips could have. Sprite is the parent elegance of MovieClip though now not all of the MovieClip homes are to be had within the determine class.
Q6. What Is Display Object?
Display object is an item which represents a few kind of visible content material in Flash Player. Only display gadgets can be covered within the display list, and all display item training are subclasses of the DisplayObject elegance. After a show item is created, it won't seem on-screen till it's far added into a show object field.
Q7. What Is A Drag Manager In Adobe Flex Actionscript?
The Flex Drag and Drop Manager helps you to choose an object, such as an item in a List control, or a Flex manage, inclusive of an Image manipulate, after which drag it over any other factor to feature it to that factor.
Q8. Explain The Difference Between Creating An Effect And Setting The Target As Opposed To Adding An Effectlistener?
To create a behavior, you outline a selected effect with a unique ID and bind it to the cause.
For instance, the subsequent code creates zoom consequences: one for shrinking the thing barely, and one for reverting it to its unique length. These consequences are assigned, with the aid of using their specific IDs, to the mouseDownEffect and mouseUpEffect triggers at the Button thing.
<mx:Application ...>
<mx:Zoom id="shrink" duration="100" zoomHeightTo=".9" zoomWidthTo=".9" />
<mx:Zoom id="revert" duration="50" zoomHeightTo="1" zoomWidthTo="1" />
<mx:Panel title="Bouncy Button" paddingTop="10" paddingBottom="10"
paddingLeft="10" paddingRight="10" autoLayout="false" left="41" top="24" right="42">
<mx:Button id="bouncyButton" label="Click me!"
mouseDownEffect="shrink" mouseUpEffect="revert"/>
</mx:Panel>
</mx:Application>
Q9. Why Are The Columns In My Datagrid In Some Strange Order?
The order is typically the reverse of the order wherein they have been introduced. If you want a particular order, specify that and many different properly matters via using DataGridColumn tags.
Q10. What Are Sealed Classes In Flex?
A sealed magnificence possesses only the constant set of residences and methods that had been described at collect-time; extra residences and techniques can't be brought. This makes stricter bring together-time checking viable, ensuing in extra strong packages.
Q11. What Keyword Allows You To Refer To Private Variables Of A Class In Flex?
Private keyword , this keyword (? ) in flex
Q12. Why Do Strongly Typed Objects Appear As "undefined" In The Netconnection Debugger?
The NetConnection Debugger is an vintage utility from the early days of Flash Remoting that a few developers nevertheless find useful. It has an problem, but, showing sorts that have been registered with Object.RegisterClass(). If your Flex server is established regionally, we advise permitting server-facet "debug" level logging in /WEB-INF/flex/gateway-config.Xml to watch the raw trace data inside the Flex server console/logs from the AMF Gateway as it methods your RemoteObject requests.
Flex Builder also consists of a Network Debugger that allows you to reveal AMF visitors.
Q13. Explain How Many Levels Does Flash Mx Support?
20
eighty
one hundred
one thousand
Q14. What Is Display Container?
Display object box is special sort of show item that can include infant display objects in addition to (generally) having its personal visual illustration. When a show object box is removed from the show list, all its kids are removed as well.
Q15. Can I Load Css Style Sheets Dynamically At Runtime?
Dynamic loading of CSS documents is not supported in Flex. CSS in Flex is processed at the server side all through MXML compilation in preference to on the patron facet at runtime. There is a trick though: A CSS report may be compiled into a separate SWF record and loaded dynamically into the utility the usage of the Loader element.
Q16. Can I Embed Html In My Flex Application?
Flex helps a limited subset of HTML in its TextArea and some different textual content-associated classes.
Q17. What Is Cairnghorm In Flex? How Do We Use It?Have You Worked With Cairnghorn In Flex?
Cairngorm is the light-weight micro-structure for Rich Internet Applications constructed in Flex or AIR. A collaboration of recognized layout styles, Cairngorm exemplifies and encourages first-class-practices for RIA development recommended through Adobe Consulting, encourages best-exercise leverage of the underlying Flex framework, even as making it easier for medium to large groups of software engineers deliver medium to large scale, venture-vital Rich Internet Applications.
The blessings of the Cairngorm structure are realized when growing complex RIA packages with more than one use-cases and views, with a group of builders, and with a multi-disciplinary improvement team that includes designers as well as innovative and technical builders.
Q18. How Do I Run Flex As A Service?
Flex is not a server which you set up and run. It is in reality deployed as a part of your web software. So it'll paintings, irrespective of which internet container you are the use of: Tomcat, JRun four, WebLogic, and so on. To discover ways to install Tomcat, JRun four, or another Java server as a carrier, discuss with an appropriate documentation for the server you are using.
Q19. Is Double-clicking Supported On Various Components?
Unfortunately, double-clicking isn't always supported with the aid of default. If you wish to add this functionality to, say, a List or DataGrid element, you'll must upload the following ActionScript 2.0 code for your utility:
var someTimestamp:Number;
public feature doubleClickHandler( evt:Object ):Void
var now = getTimer();
// we got a double-click
if( ( now - someTimestamp ) < 500 )
// do some thing right here ...
SomeTimestamp = now;
Q20. When I Set Visible="false", The Component Still Takes Up Space And Appears In The Tab Order. Why Is That?
You can frequently attain the "show=none" impact by means of placing the peak/width to 0 when you set it invisible, after which set it again to a hard and fast cost or to undefined while you make it seen again.
Q21. What Are Runtime Shared Libraries In Flex?
Macromedia Flex 1.Five you can construct runtime shared libraries (RSLs) that may be personally loaded, cached, and utilized by multiple applications.
Use Flex three runtime-shared-libraries (RSLs) to reduce the dimensions of your programs and thereby reduce the time required to down load the software. RSLs are just SWF documents whose code is used as a shared library among exceptional software SWF documents. There are kinds of RSLs, signed and unsigned. Signed RSLs are libraries that are signed by Adobe and can be saved in the Flash Player Cache, which can be accessed by using applications from any domain. This me in case your utility is the usage of a signed RSL, the RSL may not even need to be downloaded if the RSL is already within the Flash Player Cache. The signed RSL may were positioned into the Flash Player Cache with the aid of touring any other web website that became the use of the equal signed RSL. Signed RSLs have a "swz" extension.
Unsigned RSLs are ordinary SWF files and aren't loaded into the Flash Player Cache. Instead, those RSLs depend on the browser's cache to keep them from being downloaded.
Q22. How Polymorphism Works On Actionscript?
Class UnpaidIntern extends Employee
override public feature receivePayment():Number
return 0;
elegance Manager extends Employee
override public feature receivePayment():Number
go back baseSalary*three;
elegance Engineer extends Employee
override public characteristic receivePayment():Number
go back this.BaseSalary*2;
elegance Employee
internal var baseSalary:Number = 1000;
public characteristic receivePayment():Number
return this.BaseSalary;
Q23. What Is The Difference Between Sealed Class And Dynamic Classes In Flex?
Classes are sealed by means of default, i.E. Properties can not be introduced dynamically at runtime.
Dynamic instructions can add additional dynamic residences at runtime; sealed training can't.
Sealed training preserve reminiscence because no internal hash desk is needed to store dynamic homes, and the compiler can offer higher blunders remarks.
Q24. How Do We Identify A Component Created In A Repeater Using Flex?
If currentIndex price is more than startIndex cost me a factor is created in Repeater. We can use remember property to find wide variety of youngsters.A Repeater element executes to start with while it's far instantiated. If the Repeater thing's dataProvider property exists, it proceeds to instantiate its kids, and that they instantiate their kids, recursively.The Repeater element re-executes on every occasion its dataProvider, startingIndex, or count houses are set or changed both explicitly in ActionScript, or implicitly by statistics binding.
When a Repeater element re-executes, it destroys any kids that it previously created (assuming the recycleChildren assets is ready to fake), and then reinstantiates its children based totally at the modern dataProvider belongings.
Q25. What Does Calling Preventdefault() On An Event Do? How Is This Enforced?
Cancels an event's default behavior if that behavior may be canceled.. For example, the doubleClick event has an related default conduct that highlights the phrase under the mouse pointer at the time of the occasion. Your occasion listener can cancel this behavior with the aid of calling the preventDefault() approach. You can use the Event.Cancelable property to check whether or not you may prevent the default behavior related to a specific occasion. If the price of Event.Cancelable is actual, then preventDefault() may be used to cancel the occasion; otherwise, preventDefault() has no effect.
Q26. What Are The Correct Statements Concerning Text Field?
Embedded font outlines are shared by textual content fields using the same font.
Font Outlines for static for static textual content area are embedded in the SWF file by means of default.
Font define for enter textual content area are embedded in SWF file by way of default.
Individual font outlines are embedded in to the SWF record for every text subject within the FLA file.
Font outlines for dynamic text fields are embedded in SWF report through default.
Q27. What Is Polymorphism In Term Of Oop (flash Actionscript)?
Inheritance also lets in you to take advantage of polymorphism on your code. Polymorphism is the potential to apply a single method call for a technique that behaves in another way when implemented to exclusive statistics types.
Q28. What Design Patterns Have You Used? In Actionscript And Java?
Creational Pattern
Factory Method Pattern.
Singleton Pattern.
Structural Patterns
Decorator Pattern.
Adapter Pattern.
Coposite Pattern.
Behavioral Patterns
Command Pattern.
Observer Pattern.
Template Metod Pattern.
State Pattern.
Strategy Pattern.
Multiple Patterns
MVC Pattern.
Symetric Proxy Pattern.
Q29. How Can You Show A Jpg Image In Dynamic Text Field?
Using HTML Tags in HTML enabled textual content discipline you could load image in that. Make a Dynamic Text Field on Stage and provide it example call "txt", On frame paste the subsequent code and check your flash.
Code: txt.HtmlText ="<img src='http://www.Globalguideline.Com/images/ggl.Gif' width='139' height='139'> This photo is beneath Dynamic text subject of flash "
Q30. Can I Dynamically Instantiate A Web Service Or Httpservice In Actionscript?
Flex 1.Five does now not guide this. First declare the tags in MXML and then control the URLs, request items, and so on the use of ActionScript.
Q31. What Is Interface Or Benefit Of Interface In Term Of Oop?
Allows you to specify a fixed of techniques that instructions are required to put in force
Classes can put in force a couple of interfaces,interfaces can expand every-different
Interfaces can be visible as contracts to be developed in opposition to, fantastic for frameworks
Q32. How Does Item Renderer Work? How Do We Add Item Renderer At Runtime In Flex?
Each listing control has a default mechanism for controlling the show of information, or view, and lets you override that default. To override the default view, you create a custom item renderer.
Note: With reusable inline object renderers you use data binding to bind to the item renderer. When you operate a element as an object renderer, you do not use facts binding however specify the name of the custom element to apply as an item renderer.
Add itemrendrer at run time:
Create the basic item renderer. One of the things I wanted to perform with my object renderer changed into the ability to feature it to special columns (ie the dataField become not constantly the same). This supposed I wanted a manner from inside the renderer to decide what column it turned into sure to so I ought to get and display the ideal facts. To try this the renderer wishes to enforce the IDropInListItemRenderer. This interface allows the renderer to have access to facts about the list and column it is in via the BaseListData and DataGridListData classes. The DataGridListData offers you everything you need to get the statistics required to make a flexible, reusable renderer.
To Modify itemrenderer at runtime we Need to use mx.Middle.ClassFactory. Basically, so that you can alternate a Flex itemRenderer at runtime, you want to forged it to a kind ClassFactory.
Q33. Explain How Binding Works In Mxml Components In Flex?
Binding in MXML:
Lets take a look at the following code…
<mx:TextInput id=”ti1?/>
<mx:Label id=”label1? Text=”ti1.Text”/>
Here you're binding the textual content property of the TextInput to the label. So some thing you kind in the textInput mechanically reflects inside the label. That’s the electricity of Binding…
The excellent exercise for outlining components that return statistics again to the main software is to layout the factor to dispatch an event that consists of the go back statistics. In that way, the principle software can define an occasion listener to deal with the occasion and take an appropriate motion. You also use occasions in facts binding.
The following instance makes use of the Bindable metadata tag to make useShortNames a bindable property.The implicit setter for the useShortNames belongings dispatches the change event that is used internally by the Flex framework to make records binding work.
Q34. Difference Between States And Viewstack In Flex?
View Stack is to handle exclusive MXML document eg TAB manage and states is the trition within unmarried MXML report.
ViewStack ought to be used were there may be whole alternate within the controls used and States ought to be used when you simply need to add or eliminate some additives based on certain situations.
ViewStates are virtual kingdom of an existing page apearing at an instance i.E. Handiest one nation can be shown at a time
at the same time as viewStack are collection of various view packing containers which may be shown at a time
Q35. I Have I Input Text Field On Stage And I Have A Button Also, Further I Am Writing Some Text In That Input Text Field. I Want To Save My Written Data On My Local System (on My Computer), How Can I Do T
To reap this you have to use flash CS4 with Flash Player 10 or above. Using the new technique of filereference magnificence you can prevent typed textual content in your computer as a textual content record.
First create a item of filereference… then use the shop technique and bypass your records to it.
Var fR:FileReference =new FileReference()
fR.Keep("your Written textual content must be come right here.","flexflashforum.Txt")
Paste the following code on frame and run a sample software...
Code:
var TxtF:TextField = new TextField();
var BtnMc:TextField = new TextField();
var MyFile:FileReference = new FileReference();
TxtF.Border = genuine;
TxtF.Type = TextFieldType.INPUT;
BtnMc.History = actual;
BtnMc.BackgroundColor = 0xCCCCCC;
BtnMc.X = 150;
BtnMc.Peak = 20;
BtnMc.Text = " Click here to keep";
Q36. How Do I Pass Parameters To A Pop-up Window In Actionscript?
Three specific methods to skip data right into a name window.
It uses the initobj to skip in numerous built-in residences plus two consumer defined residences.
One is a easy string, the alternative is a reference to the principle software that can be used for binding. Note the variable that holds the utility reference is typed to the call of the application. This is essential for binding to paintings successfully.
Q37. When I Have Only A Single Record, Why Does Not It Appear In My Datagrid?
This is a recognized difficulty that is as a result of the incapacity of Flex to distinguish among an item and an array with a single row. The answer is to continually use toArray(), as inside the following examples:
In MXML:
mx.Utils.ArrayUtil.ToArray(modelAccidents1.Accidents.Twist of fate)
The inline format:
dataProvider=mx.Utils.ArrayUtil.ToArray(testSrv.Result.Result.Blunders)
In ActionScript:
myControl.DataProvider = mx.Utils.ArrayUtil.ToArray(testSrv.Result.Result.Mistakes)
Q38. Tell Some New Capabilities / Features Of Flash As 3.0?
URLLoader elegance to load textual content or binary data (The ActionScript 2.0 MovieClipLoader and LoadVars classes aren't used in ActionScript 3.@The Loader and URLLoader instructions replace them.)
Sound.ComputeSpectrum() (Takes a image of the cutting-edge sound wave and places it into the required ByteArray item. It returns a ByteArray containing 512 normalized values (-1 to one) that can be used to visually display the waveform of sound. 256 values for the left channel and 256 values for the proper channel. These values may be use to create Sound Spectrum Analyzer shows in Audio Players like Winamp and Windows Media Playres.)
BitmapData.GetPixels() (Generates a byte array from a rectangular vicinity of pixel data. Writes an unsigned integer (a 32-bit unmultiplied pixel cost) for every pixel into the byte array. No want to loop thru every pixel in a bitmap, one at a time with getPixel to send a bitmap to the server.)
MovieClip.CurrentLabel (This returns the label of the present day frame as a String. The contemporary label in which the playhead is positioned inside the timeline of the MovieClip instance. If the modern frame has no label, currentLabel is about to the call of the previous frame that includes a label. If the contemporary frame and previous frames do no longer consist of a label, currentLabel returns null.)
degree.FrameRate ( At runtime frame rate of stage may be trade)
Q39. How Do I Get Access To The J2ee Session From My Remoteobjects?
The AMF Gateway presents get right of entry to to the contemporary HttpServletRequest example in a thread neighborhood variable. The session can be obtained from the request, as follows:
flashgateway.Gateway.GetHttpRequest().GetSession();
Q40. What Is State? What Is The Difference Between States And Viewstack In Flex?
The State magnificence defines a view kingdom, a particular view of a aspect. For instance, a product thumbnail should have view states; a base view country with minimal data, and a wealthy view kingdom with extra statistics. The overrides belongings specifies a set of toddler lessons to add or do away with from the base view kingdom, and homes, patterns, and event handlers to set when the view state is in impact.
You use the State class within the states belongings of Flex additives. You can best specify a states assets at the basis of an application or a custom manage, not on child controls.
Q41. What Is Dynamic Keyword Used For In Actionscript?
Dynamic instructions, which allow you to programmatically add new properties and behavior to instructions during the run-time. Just add the magic key-word dynamic to the elegance definition:
dynamic class Person
var name:String;
Now allow's upload dynamically two variables name and age and the function printme() to the object of kind Person:
Person p= new Person();
p.Call=”Joe”;
p.Age=25;
p.PrintMe = characteristic ()
hint (p.Call, p.Age);
p.PrintMe(); // Joe 25
Q42. Sometimes, If I Do Not Move The Mouse, "click on" And "mousedown" Do Not Work. Why Is That?
This is a focal point trouble with Flash Player; typically when the UI adjustments "below" the mouse pointer, as in a ViewStack navigation in which the buttons are in the identical display area.
Q43. How Do You Add Event Listeners In Mxml Components. Now As3 Components?
AddEventListener(type:String, listener:Function, useCapture:Boolean = fake, precedence:int = zero, useWeakReference:Boolean = fake):void
removeEventListener(kind:String, listener:Function, useCapture:Boolean = false):void
dispatchEvent(occasion:Event):Boolean
hasEventListener(kind:String):Boolean
willTrigger(type:String):Boolean
Q44. What Is A Resource Manager In Flex Actionscript?
The ResourceManager - now handles get entry to to all localized resources in an software. Any components that expand UIComponent, Formatter, or Validator now have a brand new resourceManager belongings, which lets you without difficulty get right of entry to the singleton instance of this manager. If you're writing some different sort of class that wishes to use the ResourceManager, you may name ResourceManager.GetInstance() to get a reference to it.
Q45. What Is Mvc And How Do You Relate It To Flex Apps?
(Separation of issues) The goal of the Model-View-Controller (MVC) structure is that by means of developing components with a well-defined and restricted scope in your utility, you boom the reusability of the additives and enhance the maintainability of the general gadget. Using the MVC structure.
You can partition your machine into 3 categories of components:
Model components Encapsulates information and behaviors associated with the information.
View components Defines your software's consumer interface.
Controller additives Handles the information interconnectivity in your application.
Q46. Can I Resize The Internet Explorer Browser Window From Flex?
Use getURL() to communicate with JavaScript in the HTML wrapper:
getURL('javascript:window.ResizeTo(1050,900)');
Q47. Differences Between Defining Bindings In Mxml And Actionscript?
There are a few differences among defining records bindings in MXML at bring together time and in defining them at runtime in ActionScript:
You can't include ActionScript code in a statistics binding expression described through the bindProperty() or bindSetter() approach. Instead, use the bindSetter() method to specify a way to name whilst the binding happens.
You cannot encompass an E4X expression in a statistics binding expression described in ActionScript.
You can not consist of capabilities or array elements in belongings chains in a records binding expression defined via the bindProperty() or bindSetter() method. For more statistics on assets chains, see Working with bindable assets chains.
The MXML compiler has higher caution and mistakes detection support than runtime records bindings described by means of the bindProperty() or bindSetter() method.
Q48. Why Are My Valueobject Member Variables Undefined In The Results From My Remoteobject Requests?
Flash Player deserializes objects in a special order that may confuse builders used to object serialization from different RPC structures. When a strongly typed item is again to the player, it first creates an example from the prototype of the registered elegance without calling the constructor. It then populates the object with the homes despatched within the end result. Finally, it calls the constructor with out arguments.
If your ValueObject constructor expects arguments to initialize an example, make certain to check whether arguments have been definitely sent to the constructor earlier than overriding member variable values.
Q49. What Is Interface In Term Of Oop (flash Actionscript)?
An interface is a group of method declarations that allows unrelated gadgets to talk with one another. The shape of an interface definition is just like that of a class definition, except that an interface can comprise only strategies and not using a technique our bodies. Interfaces cannot consist of variables or constants but can consist of getters and setters. To define an interface, use the interface keyword. Use the implements key-word in a category announcement to put in force one or more interfaces.
Q50. How Do I Get Flex To Query My Database?
Flex does no longer have any local database integration functionality. You have to have your personal server-side tier that offers the database-access tier and sends the data again to Flex via one of the following protocols:
RemoteObjects: This is the quickest. It communicates with server-aspect EJBs or POJOs the use of AMF, a binary compressed format.
HTTPService: This one uses the HTTP protocol. Sources can be JSP, ASPx, .NET, or any URL that returns HTTP.
WebService: This is the slowest. It makes use of the SOAP protocol. Sources may be .NET or any internet carrier.
