Hi,

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

IMO, the mx behavior is worse than Spark, so I don't recommend to replicate mx 
behavior on ALL spark skinnableComponents, this is a very bad idea, and this 
will affect all the existing Flex Spark projects.

What you want to achieve is an edge case, not a common case, so I recommend you 
subclass the SkinableComponent (like MySkinableComponent), and override any 
behaviors you want, then make all of your custom components by subclass your 
MySkinableComponent.


DarkStone
2014-07-17


At 2014-07-17 06:37:37, "João Fernandes" <joaopedromartinsfernan...@gmail.com> 
wrote:
>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