Sorry but setting mouseChildren and mouseEnabled won't work for their
customSkin since skinnableComponent does check if the component is enabled
and skip the call to super.mouseChildren/mouseEnabled. Subclassing is not
an option in this case because it would require the entire spark components
to be rewritten extending the new class and monkey patching isn't an option.

What I want to achieve is to replicate mx behavior on ALL spark
skinnableComponents but keeping the current behavior as the default.


On 17 July 2014 11:14, DarkStone <darkst...@163.com> wrote:

> Hi,
>
> MX (Halo) was discontinued long time ago.
>
> The 'enabled' implementation of the Spark SkinnableComponent is correct,
> no need to change, it's better this way, because developers can explicitly
> set the values of the mouseChildren and mouseEnabled for their
> CustomSkin.mxml.
>
> If you do want to change it, you can subclass the SkinnableComponent, and
> override the public function set enabled(value:Boolean):void to whatever
> you want it to be.
>
>
> DarkStone
> 2014-07-17
>
>
> At 2014-07-17 05:51:46, João Fernandes" <
> joaopedromartinsfernan...@gmail.com> wrote:
> >Hi, something that has bugging me is that skinnable components behave
> >differently from mx conter part when the object has enabled = false.
> >In MX all components still respond to mouseEvents while skinnable won't
> >because at the skinnableComponent level we have this
> >
> >    override public function set enabled(value:Boolean):void
> >    {
> >        super.enabled = value;
> >        invalidateSkinState();
> >
> >        // If enabled, reset the mouseChildren, mouseEnabled to the
> >previously
> >        // set explicit value, otherwise disable mouse interaction.
> >        super.mouseChildren = value ? _explicitMouseChildren : false;
> >        super.mouseEnabled  = value ? _explicitMouseEnabled  : false;
> >    }
> >
> >I plan to implement a similar mx behavior but keeping the current behavior
> >as the default.
> >
> >Before I start doing anything, is there any reason for this difference in
> >behavior?
> >
> >--
> >
> >João Fernandes
>



-- 

João Fernandes

Reply via email to