Hi all,
I have a ready simple calculater design.
and i learned the Action Script languge last month
i just tried to add a Mouse Lestiner for a buttons(actually it's not button but it customized to act like a button = the No. ZERO button = num0_btn as shown in the code below. )
but it doesn't work.
it works correct with the normal button ( = tst_btn ) as shown in the code below.
and this is the code:
------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ -----------------------------
var num0_btn:mx.controls.Button;
var tst_btn:mx.controls.Button;
var btnListener:Object = new Object();
btnListener.click = function(evt:Object)
{
//do something
trace("there is a button pressed");
}
num0_btn.addEventListener("click", btnListener);
tst_btn.addEventListener("click", btnListener);
------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ ---------------------------------
Hoooooooooope to help me please. as soon as possible.
thx all,...................................................................................
Simply use the following code
num0_btn.onRlease = function()
{
//do something
trace("there is a button pressed");
}
Typo... onRelease, not onRlease
thanx aLooooooooooot guys
the problem solved and i appreciate your reply.