Check When SWF Has Focus?
Feb 9, 2011How can I check if a SWF element on a page has focus?
In IE, onkeydown events are not detected in JavaScript if a SWF has focus but Firefox always detects onkeydown.
How can I check if a SWF element on a page has focus?
In IE, onkeydown events are not detected in JavaScript if a SWF has focus but Firefox always detects onkeydown.
I have an activate and deactivate event handlers for the main Application that trigger when the user clicks inside or outside the browser or flex application browser window. Due to some subtle changes I made to my app (I suspect unforeseen by Adobe) activate and deactivate events are no longer triggered. Is there a hasFocus type function I can call instead in enterFrame for example
View 1 Replies[Code]...
when i have this line active(the red one) it gives me automatic focus, so no clicking to be able to detect key input so i got that going for me which is nice BUT when i have it active(not commented out) i get this big yellow line which goes away when i click it(seeBelow)
Does anyone know how to do this in AS3?
View 3 Repliescan I set the keyboard focus for a TLFTextField? I tried stage.focus = myTLF but there is no cursor...
View 2 RepliesI have a TextField called textField on the first frame of the main timeline, and this simple code.
Code:
import flash.events.KeyboardEvent;
import flash.events.FocusEvent;
[code]......
See [URL] Now there is a button called Answera, which when clicked should have a symbol (movie clip) called Check appear at the cordinated specified. Check exists in the libary (but does not have an instance name) and no where else on the stage. when I run this code I get: 1180: Call to a possibly undefined method Check. -> var rightCheck = new Check(); How is it undefinded if it exists in the libary?
View 7 RepliesThe following is my codes. This is still work in progress; so, you will see some functions with empty contents. Plus, this is my first Flex application; please bear with me. This is a quiz application that gets the questions and answers to each questions from a ColdFusion web service. There are three types of questions, True or False, Multiple Choice with single selection, and Multiple Choice with multiple selections. So, based upon the question type, the application would dynamically generate the appropriate amount of radio buttons or check boxes for the users to select. I got these working. The problem that I am having is, I am not sure how to check what the users have actually selected. In some other forums and posts on other web site, it said that I can use event.currentTarget.selectedValue to get the user selection. But when I actually do it, I got a run-time error saying, "Property selectedValue not found on mx.controls.FormItem and there is no default value." My question is, what do I need to do to capture the user selections?
[Code]...
I have a game where you can move a character around on a screen, very simple. My problem is, I have to click on the swf object in my browser before it starts to recognize my input keys. If there a way to set set to my swf object either in html or the swf itself /w as3?
This is the browser code I keep finding on googing:
Actionscript Code:
<body onLoad="window.document.mymovie.focus();"> <object width="760" height="820"> <param name="mymovie" value="test.swf"> <embed src="test.swf" width="760" height="820"> </embed> </object> </body>
When I publish a Flash CS4 Pro / AS3 game to an SWF file and uploads it to my webserver, I have to click the screen before I can use keyboard events.
Is there a way to force a focus onto the "swf stage" when loading the file in the browser, or do I have to publish an html file that controls the swf file to do that?[url]...
Upon entering the screen, I set the focus to the first field, a combobox, and after making a selection I want to tab to the next field, a textfield, but I can't tab out of the combobox. I can use the mouse to click on the textfield and give it focus but I'd rather tab. I also tried to programatically give focus to the textfield (from the function associated with the combox's listener) without success.
View 10 Repliesdoes anyone know how to 'focus' on a flash movie? for example, my flash webpage has a button that when clicked opens a flash movie. i want the main site to darken and the flash movie to be in front in focus.url...
View 2 RepliesI want to focus the textfield with a cursor on it without clicking on the same and without using Ifocusmanager as I have taken the textField.
I have tried stage.focus but it doesn't seem to work the way I want.
I'm not that great with Actionscript 3.0, so naturally I have an hurdle to leap.
I using the 3D Carousel from flashcomponents.net and I need to figure out how to get the images blur when they are not the front focal on the Carousel. I tried an onRelease (which works to un-blur it), but I didn't know what else to pair it with so when I click on another object it blurs and goes to the back. I don't want it to blur when I roll off, only when another object is clicked.
I did embed an swf file in html.The file is working fine in all browsers except opera(all versions).I am facing problem that flash didn't get focus when application initially load.User has to click on page.Then the application works fine.
[Code]...
I've been working on creatbutton using a MovieClip. I'm using the following events:
this.addEventListener(MouseEvent.CLICK,OnClick);
this.addEventListener(MouseEvent.ROLL_OVER,OnButtonRollOver);
this.addEventListener(MouseEvent.ROLL_OUT,OnButtonRollOut);
[code]....
I try to figure out how does focus mechanism work in Flex. Here comes the example of what I mean:Let's assume that we have a simple web application, which contains custom component that extends Canvas and implements mx.managers.IFocusManagerComponent. This component overrides focusInHandler and focusOutHandler methods and shows some feedback on how they are called (thinner or thicker border). This custom component also contains some Text.[code]
If you click once on a violet canvas it receives focus (focusInHandler is called), then if you click again the focus is lost (focusOutHandler called) - why?Of you click on a Text the Canvas receives focus (focusInHandler called) and keeps it when being clicked wherever on the area (focusOutHandler nevet called) - why?
I am trying to make an editable DataGrid to insert a new row when user presses TAB in the last column of last row.y Grid:
<mx:DataGrid id="myGrid"
dataProvider="{initDG}" editable="true"
itemFocusOut="onItemFocusOut(event)">
[code]....
Now that setFocus() is gone, how do you tell the player to set focus to a specific input text field. I've searched thru the reference docs and haven't had any luck.
View 9 RepliesI have the swf embedded in a html page and want to know if it is possible to set the focus so that it is within the swf and not the html (browser) when the page loads. You have to click on the swf to make it active, I do want this.
View 2 RepliesI'm using the following code to set focus to a text box on my stage. stage.focus = txtAnswer.The problem is this. If the user don't click at least once on my movie clip it doesn't seems to register the text box (flickering cursor).
View 1 RepliesI have a textbox and listbox. when i enter something on textbox it should filter the text and listout the result in listbox. this works fine for me. my problem is how can i make keyboard enabled controls. both the way. eg, enter xyz in text when i press down arrow key it should goto listbox and able to select value using up,down and enter key's.
View 0 RepliesHow can I get the previous focus so I can compare what is in the textInput to what the user should have typed? I am wanting to check after the user types in their answer and clicks, tabs, or pushes enter to the next box.
View 0 RepliesSometimes it is necessary just to kill focus (e.g. from the TextField instance). But I found no ways to do that. The only solutions is to set focus on another instance that handles mouse events.
View 9 Repliesi am using a simple flash email form with three input areas: name, email and message. What i have is an empty movie clip with an onClipEvent (mouseUp) action applied to it which removes the text within each text field when it is selected. This is so i can have "name", "email" and "message" written in the input text boxes, which dissapears when the user selects it. The problem is that if someone puts their text in then reselects it after doing something else, then their text also dissapears... i suppose im looking for a way to remove the focus just once, or another way of removing the focus. here is the actionscript applied to the empty movieclip:
[Code]...
Does anyone know if there is a way to set focus to the next item in the tabIndex? So for example (in psuedo code): stage.focus = whatever the next item in the tabIndex is
Maybe something like tabIndex.next? I know this doesn't work because I already tried it, but maybe something like it?
The 1st layer spans all 10 frames and has a MC called The 2nd layer has a MC called and a button calledThe 3rd layer has frame labels for each frame:The 4th layer has actions that are similar for each frame:
Code:
nextBtn1.addEventListener(MouseEvent.CLICK, Q1btn);
function Q1btn(e:Event)
[code].....
is there a class or general method used to know if the browser has focus of the swf or not?
View 3 RepliesI have a movie that has been working fine until FP10 (3 years plus ). The issue is that a textinput field only gets focus on the first load of the movie. Subsequent loads none of the text input fields get focus, even when stepping through the movie focus is not automatically set. Unless the cache is cleared and the movie reloaded from our website.
I can reproduce it over and over, by clearing the cache movie works, all loads afterwards textinput boxes do not get focus.
Same results in IE 8, FF3 and Chrome. All using the latest flash player 10,1,53,64
It suggests a timingcode loadexecute issue ... introduced in FP10, but how to get around it ?
I am just embarking on a rewrite in Flex but that is some way off yet and something as simple as setting focus to the next field to be filled in affects the user experience.
I have to input feilds. Inside the feilds (through variables) I have "username" writen. How can I clear this feild when the user focuses on the feild?In a frame script I have:
if (selection.getFocus() == _level0.loginPageMC.userTxt) {
userTxt = "";
}
[code]....