|
INTERVIEW QUESTIONS
WEB
ACTION SCRIPT
DETAILS
Question: What is the difference between ChangeWatcher.watch, and BindingUtils.bindProperty?
Answer: 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.
|
|
|
Category |
Action Script Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.2) By 9631 users |
Added on |
9/22/2014 |
Views |
68244 |
Rate it! |
|
|
Question:
What is the difference between ChangeWatcher.watch, and BindingUtils.bindProperty?
Answer:
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. Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
Explain how binding works in mxml components in flex?
|
View Answer
|
|
What design patterns have you used? in Actionscript and java?
|
View Answer
|
|
What keyword allows us to implement abstraction better in flex?
|
View Answer
|
|
What is cairnghorm in flex? how do we use it?Have you worked with Cairnghorn in flex?
|
View Answer
|
|
What are runtime shared libraries in flex?
|
View Answer
|
|
What are sealed classes in flex?
|
View Answer
|
|
What is dynamic keyword used for in actionscript?
|
View Answer
|
|
How do we overload functions in actionscript?
|
View Answer
|
|
How polymorphism works on actionscript?
|
View Answer
|
|
What keyword allows you to refer to private variables of a class in flex?
|
View Answer
|
|
How does item renderer work? How do we add item renderer at runtime in flex?
|
View Answer
|
|
What is state? what is the difference between states and ViewStack in flex?
|
View Answer
|
|
What is MVC and how do you relate it to flex apps?
|
View Answer
|
|
What is the difference between sealed class and dynamic classes in flex?
|
View Answer
|
|
How do we use css styles in flex?
|
View Answer
|
|
what are three ways to skin a component in flex?
|
View Answer
|
|
How do you use a repeater in actionscript?
|
View Answer
|
|
How do we call javascript from Flex actionscript?
|
View Answer
|
|
What is a drag manager in adobe flex actionscript?
|
View Answer
|
|
Can you write to the file system from flex?
|
View Answer
|
Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.
View All Action Script Interview Questions & Answers - Exam Mode /
Learning Mode
|