I have a textfield in flex with a focusOut event on it. I can type in the box and in Firefox and Chrome when I click elsewhere on the page (outside the flash element) the focusOut event will be triggered. However in IE8, the texfield never loses focus when you click elsewhere on the page, outside the flash object. I've tried with focusManager.browserMode set to true and false with no difference (I believe that effects incoming focus anyway). Does anyone have any idea why?
check if your application becomes deactivated when the user clicks outside
Related
Can anyone explain me what the difference between focus, focusleave and focusenter on button method with extjs, I'm lost because it seems to be the same when I add event listener. Thanks
kind regards
difference between focus, focusleave and focusenter on button method
with extjs
Method? I guess you mean the events right? Cos:
The focus method will focus your button when you call it.
As you can see on the picture the middle button has focus, you can change the focus on the webpage usually by using TAB key. ExtJS supports full control over your app using keyboard.
The focus, focusenter, focusleave events. If you are not sure what to use - just use "focus"
The focus event should be clear - it's simply fired when the button has focus.
The focusenter is fired when the component get's focus but as the docs states it's also fired in the whole component hirearchy. That means that if the button is in panel which is in view and you focus the button - the focusenter will be fired on the view, panel, button.
main -> panel -> button
Events
The focusleave is the same as focus enter. Fired when focus is lost on the component - again fired in the whole hirearchy. So if the focus went completly away form the page you would see focus leave on the button -> panel -> view
I am using an HTML5 video tag with videoJS (last stable release, 4.12). I have no trouble to get the loadedmetadata event but for some reason I probably missed, I can't hook using the "meteor way" on the video object play event.
My template events code:
Template.Player.events({
'loadedmetadata #video_player':function (e,t) {
console.log(e.target); //working fine
},
'play #video_player':function(e,t){
console.log("play!");//now it works
}
});
I am debugging on Chrome but i guess it is not browser related.
edit:
It appears that it works when I don't use id or class selectors. Since I have only one video tag on my template, I can catch the play event by doing this:
Template.Player.events({
'play video':function(e,t){
console.log("play!");//not working
}
});
I still don't buy the fact that meteor can't handle that. If so, why? What is the difference between loadedmetadata and play events that allows the first to use an id selector when the latter can't?
play triggers only when playback is resumed, playing triggers every
time playback starts.
#Oskar, you are right when I look at the documentation. However, in my case, play triggers both when starting a video and when resuming it after a pause.
First off, make sure you're using the correct event - play triggers only when playback is resumed, playing triggers every time playback starts.
Looking at the Meteor docs, these are the events that are "officially" supported:
Event types and their uses include:
click
Mouse click on any element, including a link, button, form control, or div. Use preventDefault() to prevent a clicked link from being followed. Some ways of activating an element from the keyboard also fire click.
dblclick
Double-click.
focus, blur
A text input field or other form control gains or loses focus. You can make any element focusable by giving it a tabindex property. Browsers differ on whether links, checkboxes, and radio buttons are natively focusable. These events do not bubble.
change
A checkbox or radio button changes state. For text fields, use blur or key events to respond to changes.
mouseenter, mouseleave
The pointer enters or leaves the bounds of an element. These events do not bubble.
mousedown, mouseup
The mouse button is newly down or up.
keydown, keypress, keyup
The user presses a keyboard key. keypress is most useful for catching typing in text fields, while keydown and keyup can be used for arrow keys or modifier keys.
Other DOM events are available as well, but for the events above, Meteor has taken some care to ensure that they work uniformly in all browsers.
In an accessible flex app, the user can navigate through the control by using the TAB key.
The flex app pops up on top of the html page aftert the user activate a particular link, and is loaded using swfobject.embedSWF.
It works well in most cases, but there are some instances where either or both these happen:
a) The flex app loads ok, the "flex focus" is set on the intro text label to read out loud, but pressing tab seems to still cycle through the links on the page behind. (Now Fixed, see Edit 2)
b) The focus worked well and pressing tab cycle through the controls ok, but after going through them it then tabs out of the flex app and onto the address bar.. it becomes a nightmare to even try to get back to the flex app without clicking on it.. which isn't exactly accessibility friendly.
Is there any way to prevent these from happening?
EDIT: The target browser is IE. Seems to be the most used with Jaws
EDIT: I managed to fix problem (a). The trick was to call focus on the swf object, but after a slight time out - must be something to do with flash/js ready state.
setTimeout(function(){
document.getElementById('swfobject').focus()
},25);
Problem (b) is still an issue though...
In your mx:Application component, add an event listener for the keyFocusChange and add this code :
protected function application1_keyFocusChangeHandler(event:FocusEvent):void
{
event.preventDefault();
focusManager.getNextFocusManagerComponent(event.shiftKey).setFocus();
}
b) Try to place some focusable element after swf in html. When focus leaves flex app, see if onfocus handler of that element gets called. If it is, you can refocus flex app from there or redirect it where you want.
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 fullscreen 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.
I want to be notified when a FLex Panel gets or loses focus. I've overridden the focusInHandler() and the focusOutHandler(), but they don't get called when I click on the panel.
The panels style changes indicating that it has the focus, but the handler doesn't get called.
What am I missing?
Containers (and implicitly panels) aren't really focusable. Meaning that simply clicking on an empty container won't give it focus, and in consequence, won't trigger the event handler for "focusIn". In order for a container to "gain" focus, a child of that container, that implements IFocusManagerComponent interface, has to gain focus.
So if you want your panel to trigger the "focusIn" event when clicking on it, you should focus a focusable child of that panel on mouse click.
Have you tried to explicitly listen for that event:
myPanel.addEventListener(FocusEvent.FOCUS_IN, myEventHandler);
and made sure that it was getting called?