Adobe Flex Actionscript

  Home  Adobe  Adobe Flex Actionscript


“Adobe Flex and Actionscript Interview Questions Answers Tutorial and Guide to build your knowledge for better career. Adobe Flex is a highly productive application also called actionscript, its free and open source framework for building and maintaining expressive web applications that deploy consistently on all the web browsers, desktops, and operating systems. Adobe Flex actionscript Interview Questions and Answers will guide you about all the aspects of Adobe Flex Actionscript.”



84 Adobe Flex Actionscript Questions And Answers

65⟩ What Is Interface or Benefit of Interface in term of OOP?

► Allows you to specify a set of methods that

classes are required to implement

► Classes can implement multiple interfaces,

interfaces can extend each-other

► Interfaces can be seen as contracts to be

developed against, great for frameworks

 119 views

66⟩ What Is Event Flow in term of Event Handling in Flash Action Script 3.0?

The event flow describes how an event object moves through the display list. The event flow is conceptually divided into three parts.

Capture phase: This phase comprises all of the nodes from the Stage to the parent of the target node

Target phase: This consists solely of the target node.

Bubbling phase: The bubbling phase comprises the nodes encountered on the return trip from the parent of the target node back to the Stage.

The ability to add event listeners along the event flow is useful when a user interface component comprises more than one object. For example, a button object often contains a text object that serves as the button's label. Without the ability to add a listener to the event flow, you would have to add a listener to both the button object and the text object to ensure that you receive notification about click events that occur anywhere on the button. The existence of the event flow, however, allows you to place a single event listener on the button object that handles click events that occur either on the text object or on the areas of the button object that are not obscured by the text object.

 108 views

67⟩ What Is the Model-View-Controller (MVC) Pattern?

The Model-View-Controller (MVC) is a compound pattern, or multiple patterns working together to create complexapplications.

► Model Contains the application data and logic to manage the state of the application

► View Presents the user interface and the state of the application onscreen

► Controller Handles user input to change the state of the application

 114 views

68⟩ What is Display container?

Display object container is special type of display object which can contain child display objects in addition to (generally) having its own visual representation. When a display object container is removed from the display list, all its children are removed as well.

 119 views

69⟩ What is Display object?

Display object is an object which represents some type of visual content in Flash Player. Only display objects can be included in the display list, and all display object classes are subclasses of the DisplayObject class. After a display object is created, it won't appear on-screen until it is added into a display object container.

 110 views

70⟩ What is Display list?

Display list is hierarchy of display objects that will be rendered as visible screen content by Flash Player. The Stage is the root of the display list, and all the display objects that are attached to the Stage or one of its children form the display list (even if the object isn't actually rendered, for example if it's outside the boundaries of the Stage).

 117 views

73⟩ What is the difference between ChangeWatcher.watch, and BindingUtils.bindProperty?

ChangeWatcher:

Acts like the watch on AS2. It watches a variable for changes and when something happens fires an event. Make sure you call the canWatch to ensure that you can watch it!

There are 3 ways to specify the second parameter, the chain.

1. A String containing the name of a public bindable property of the host object.

ChangeWatcher.watch(this, "myvar", handler)

2. An Object in the form: { name: property name, access: function(host) { return host[name] } }. The Object contains the name of a public bindable property, and a function which serves as a getter for that property.

ChangeWatcher.watch(this, { name:"myvar", getter: function():String { return "something" }}, handler);

3. A non-empty Array containing any combination of the first two options. This represents a chain of bindable properties accessible from the host. For example, to watch the property host.a.b.c, call the method as: watch(host, ["a","b","c"]

BindingUtils.bindProperty

Works pretty much the same way as the watch, but instead of having to handle and event it allows you to immediately bind two properties one-way.

The first two parameters are for the the target, the second parameters are the triggers.

BindingUtils.bindProperty( this, "va1", this, "var2");

Note : Make sure you add the flex framework.swc to your project Library Path to have access to the mx.binding.util class.

 127 views

74⟩ How do you add event listeners in mxml components. Now AS3 components?

* addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void

* removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void

* dispatchEvent(event:Event):Boolean

* hasEventListener(type:String):Boolean

* willTrigger(type:String):Boolean

 123 views

75⟩ What does calling preventDefault() on an event do? How is this enforced?

Cancels an event's default behavior if that behavior can be canceled.. For example, the doubleClick event has an associated default behavior that highlights the word under the mouse pointer at the time of the event. Your event listener can cancel this behavior by calling the preventDefault() method.

You can use the Event.cancelable property to check whether you can prevent the default behavior associated with a particular event. If the value of Event.cancelable is true, then preventDefault() can be used to cancel the event; otherwise, preventDefault() has no effect.

 123 views

76⟩ What is the problem with calling setStyle()

Calling the setStyle() method can result in decreased performance. Use it only when necessary.

You should try to apply style sheets rather than use the setStyle() method because it is computationally expensive. This method should only be used when you are changing an object's styles during run time.

You cannot get or set style properties directly on a component as you can with other properties. Instead, you set style properties at run time by using the getStyle() and setStyle() ActionScript methods.

 133 views

77⟩ Differences between defining bindings in MXML and ActionScript?

There are a few differences between defining data bindings in MXML at compile time and in defining them at runtime in ActionScript:

* You cannot include ActionScript code in a data binding expression defined by the bindProperty() or bindSetter() method. Instead, use the bindSetter() method to specify a method to call when the binding occurs.

* You cannot include an E4X expression in a data binding expression defined in ActionScript.

* You cannot include functions or array elements in property chains in a data binding expression defined by the bindProperty() or bindSetter() method. For more information on property chains, see Working with bindable property chains.

* The MXML compiler has better warning and error detection support than runtime data bindings defined by the bindProperty() or bindSetter() method.

 136 views

79⟩ Explain the difference between creating an effect and setting the target as opposed to adding an effectListener?

To create a behavior, you define a specific effect with a unique ID and bind it to the trigger.

For example, the following code creates two zoom effects: one for shrinking the component slightly, and one for reverting it to its original size. These effects are assigned, by using their unique IDs, to the mouseDownEffect and mouseUpEffect triggers on the Button component.

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

 131 views

80⟩ How do we identify a component created in a repeater using flex?

If currentIndex value is greater than startIndex value means a component is created in Repeater. We can use count property to find number of children.

A Repeater component executes initially when it is instantiated. If the Repeater component's dataProvider property exists, it proceeds to instantiate its children, and they instantiate their children, recursively.

The Repeater component re-executes whenever its dataProvider, startingIndex, or count properties are set or modified either explicitly in ActionScript, or implicitly by data binding.

When a Repeater component re-executes, it destroys any children that it previously created (assuming the recycleChildren property is set to false), and then reinstantiates its children based on the current dataProvider property.

 144 views