We’re working on a rush project and to save time are using our designer’s mock-up as a starting point (we usually re-create it from the ground up). One issue is that he occasionally uses plain old Flash buttons instead of Button components because you can’t instance skin a button on stage.
In order to work with these buttons we usually use a simple onRelease handler that calls a function on _parent, as in the following example.
buttonOne.onRelease = function() {
this._parent.buttonOneClick();
}
function buttonOneClick() {
trace("one");
}
But after a little experimenting we found that the new mx.utils.Delegate class included with the Flash MX 2004 7.2 Updater can be used with plain old Flash buttons too, not just components. The following example is a little cleaner.
import mx.utils.Delegate;
buttonTwo.onRelease = Delegate.create(this, buttonTwoClick);
function buttonTwoClick() {
trace("two");
}
Read more about Delegate in Mike Chamber’s article on DevNet.
Hello there,
Iwas browsing the web and found this blog. Some interesting quotes. Keep them coming!
Alice
rapid weight loss thermocarb cheap pill
Welcome Home Everyone Home
Cya
Max
Hi Guys
Thanks for taking the time posting. MSN have finally launch blogs, what was with the delay?
Call Centre Application
Cya
Bruce
I’m Batsy,
from UAE,
and I’m 19 y.o
Hi, Everyone
I’ve studied English sinse this Winter .
It’s Really difficult
I would like like to meet boys and practisice My English with them.
Thanks!!!