开发者

Flex 4: How to override the default button functionality in a skin class?

开发者 https://www.devze.com 2023-01-07 20:26 出处:网络
I have a videoplayer with a custom skin class.I want to override the functionality of the fullscreen button.When I add an click event, the player still goes into fullscreen mode.How can I prevent the

I have a videoplayer with a custom skin class. I want to override the functionality of the fullscreen button. When I add an click event, the player still goes into fullscreen mode. How can I prevent the ful开发者_开发知识库lscreen event from firing?


It turns out that if you change the id of the button to anything other than the default then you regain full control over the button.

I changed fullScreenButton to customFullScreenButton (below):

        <s:Button id="customFullScreenButton" label="Fullscreen"  
        click="handleFullscreenButtonClicked(event);"
                skinClass="FullScreenButtonSkin"/>


Have you tried calling stopImmediatePropagation on the event when your event listener gets called? That should stop it from bubbling, but I'm not sure if your listener will get it first. It's worth a shot though. Hope that helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消