PDA

View Full Version : [AS3] numericalStepper enabled problem


sureshdavid
11-26-2009, 05:33 AM
Hi,

I'm newbie to as3,...

Here I have found a strange problem,... i have already make enabled false in a numericalstepper component, but even its in enabled false stage it has a mouse click event, why this happened?...

Any method to clear the mouseClick event when i enabled false a numerical stepper..

My script is here..

var NS:NumericStepper = new NumericStepper();
addChild(NS);
NS.enabled = false;
hope you understand , and help me...

codeman22
11-27-2009, 01:10 AM
Just drag the component on the stage with an instance name of NS.

Then use only your last line of code.

The numeric stepper will appear grayed out and will not work.

sureshdavid
11-27-2009, 08:27 AM
Thanks for reply codeman,.....

I tried but,... If i click on the numericstepper its focused by blue color...

If i click on the numericalstepper it rounded by a blue colors when numericalstepper's enabled is false..

If i make this enabled to false, this on click function is working always.. why this happened,

I want to remove the click event at the presence of enabled false....

GiCmo
11-27-2009, 09:49 AM
The blue border added is caused by the TextField inside the numericStepper.

So you need to disable mouseEvents from the textField inside.

To do that use: NS.mouseChildren = false; which disables mouseEvents for everything NS contains as a child.

This goes to any future movieClip or Sprite you will create which you will want to disable its mouseEvents. Always think of the children they have :)

sureshdavid
11-27-2009, 10:49 AM
Nice Gicmo..
:)It works.. Thank you so much..:)