Flex 4: How to override the default button functionality in a skin class?
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.
精彩评论