ActionScript 3.0 :: Stage Key Listener Losing Focus?
Nov 3, 2008
I have a class listening for key presses attached to the stage, works fine until...a menu item that when clicked removes the menu from the display list. This seems to cause the stage to lose focus & I need to click the mouse on the SWF to get the keys to register again.
View 4 Replies
Similar Posts:
Feb 2, 2010
I built this incredibly brilliant scrolling thumbnail image viewer for a client in flash actionscript 3. (Basically it just scrolls up or down depending on the mouse position). It works so so, (I can never get the percentages right so that it shows the top most image) but, that's beside the point. What is REALLY irking me is when I have the browser window open with my .swf loaded and I click on another app on my desktop, the stupid scrolling thumbnail area in the browser window starts to freak out.
"Where is my mouseY?" I assume it is thinking.
Is there a stage.Unfocus event I can tell my scrolling thumbnail area to STFU with?
I'd even consider writing some javascript to call a flash function, if that's a preferred technique.
function checkMousePos(e:Event):void
{
if(mouseX < 145){
try{
[Code]...
View 2 Replies
Oct 28, 2008
Does anyone know if there's a workaround to the fact that when you escape fullscreen mode in a browser, the swf seems to lose focus? I'm doing fullscreen video and I have to press the pause button twice when returning from fullscreen. I noticed the same problem with YouTube videos.
View 1 Replies
Dec 4, 2010
i have a button that clears the entire TextField but clicking the button makes me lose focus from the TextField. Right now I'm just putting the focus back with stage.focus = textField; as the event occurs.
Is it possible to somehow not lose focus from a TextField when pressing a button?
View 3 Replies
Jan 25, 2010
In my Flex Project using Cairngorm, I have a model that stores a bindable ArrayCollection displayed by a DataGrid. My problem occurs when the model is updated by the responder (from a Java service, after an "update" event), because the focus located in a cell of the DataGrid is lost (the scroll position il also lost). So, I retrieve the position before the update, with DataGridEvent.ITEM_FOCUS_IN event :
myModel.focusedCell.rowIndex = e.rowIndex;
myModel.focusedCell.columnIndex = e.columnIndex;
But, from where restore these parameters ? How to trigger this update only when the model is updated ?
View 1 Replies
Jan 26, 2009
I have a flash piece that replaces the mouse with a knife/sword graphic. When the user clicks (anywhere) the knife animates, 'slashing' the background. The click does something like..knife.gotoAndPlay(2);The animation is about 10 frames long... The problem is sometimes the click does nothing, as if it takes a single click just to focus the mouse. Rapid-clicking seems to have the desired effect if it wasn't for the aforementioned bug. I've tried a mouse listener as well as the standard on... methods and I'm still having the issue.Also, unfortunately due to client restrictions I'm having to code this flash piece in AS2 as opposed to AS3.
View 1 Replies
Apr 13, 2009
Line 1 Frame 1:
[Code]...
I am trying to trace the results of my listener when the browser is resized...no avail. Are you able to see what I am doing wrong?
View 1 Replies
Apr 5, 2011
I'm trying to use the following code to add a listener to a text field which clears the field, but I'm getting the error: "Parameter Listener Must be Non-Null" This is the code I'm using:
[Code]...
I should add that this text fields starts out on stage as a dynamic text field. In the code above I am changing its type to input, so that might affect things. I am trying to set up the field so that when a user clicks in the text field, a cursor movie clip appears, and the text that was in the field is erased, and that when they leave the text field and click elsewhere, the text is accepted, the textfield converts back to a dynamic field, essentially "locking" the entered text into the field.
View 3 Replies
Apr 11, 2007
I'm having trouble setting the focus on the next text box on the form after a message is displayed. Here is what I have??
[Code]...
View 1 Replies
Feb 14, 2010
I ran into an interesting problem while constructing an interactive applet today. It requires reaction to keyboard presses/releases, so I set up the appropriate listener to the stage. It also involves transitioning between different screens and I handle this by adding/removing instances of the sub-screens to the DisplayList of the stage. Now, here comes the interesting part: from my Control class in reaction to a SWITCH_SCREENS Event:
[Code]...
View 4 Replies
Aug 21, 2010
I am new to AS3 and trying to figure out how to set a focus to a textfield on the stage. I found out that if I use stage.focus = tf; then the tf get the focus and it does, when I type letters they go directly to this textfield.Problems are, I don't have a blinking cursor in the textfield. I added event listener to catch up when the user press the ENTER key but it catches the ENTER key ONLY after I click the textfield with the mouse and having a blinking cursor in that textfield.
View 4 Replies
Feb 25, 2011
My app has a datagrid as well as many other UIComponents (buttons, menus, etc). I have a general stage KeyDown handler as well as a specific one for the datagrid. The behavior I'm trying to implement is turning out to be trickier than I thought: basically, when using the keyboard arrows I would like the datagrid to always hear about such commands, even if it's not in focus.
Possible approaches I thought of:have the DG be in focus at all times: seems stupid / tricky - basically would need to remember to give focus back to DG after any interaction with the rest of the UI, which obviously doesn't scale.try to set the DG in focus from stage KeyDown handler: seems like the timing doesn't work since the DG gets focus too late to "hear" the event.from the stage keydown handler, check if the DG is not in focus, and if so pass it the event. This seems to make sense in theory, but I'm not sure how to do this properly since my stage keyDown handler uses capture, and thus seems to catch the same event over and over.
View 1 Replies
Jun 25, 2009
Is there any reliable way to give the stage focus when you first open it in a browser window WITHOUT first clicking on the stage? By reliable, I mean something that works across different browsers and on both PCs and Macs.I've seen numerous threads on this subject, and I've read the Adobe tech note, and it seems there is no reliable way.How in the world can Adobe ask people to use Flash and not provide a reliable way to give the stage focus on startup.
View 1 Replies
Jun 24, 2010
I want to have it so that when text is entered into an input text field, the cursor advances automatically to the next text field. The text fields are nameed box1, box2 and so on, and are custom classes called Box. So far I have:
[Code]....
How do I get from a string variable to the stage.focus?
View 5 Replies
May 12, 2011
stage.focus = txt_firstnameEdit;
I need to make the blinking cursor at the txt_firstnameEdit when I enter the stage. but the blinking cursor appeared infront of string_0. string_0 is pre-entered in the textbox in my code.
For example this is what I see in the textbox...
INameless
I = The blinking cursor.
How do I make the blinking cursor go behind like this?
NamelessI
View 2 Replies
Oct 5, 2008
stage.focus = txt; // txt is a text input field
It successfully gives the TextField "txt" focus because when I type, the characters appear in the input textfield, however the familiar blinking text cursor/beam does not appear in the textfield. This makes you think it does not have focus, so you click the textfield to give it focus -- completely defeating the purpose.
View 1 Replies
May 16, 2011
I have created a container in Flash Professional CS5 for my project's CBT. I've been able to script many of the features we require using AS3, but there are a couple of things I'm still trying to work out. I would like the swf presently playing in one tab to pause and go silent when another swf is opened in a new tab (the sound is inside this externally loaded swf which is loaded inside a movie clip from buttons nested a movie clip down). I've tried :
var originalFrameRate:uint = stage.frameRate;
var standbyFrameRate:uint = 0;
addEventListener(Event.ACTIVATE, onActivate);
addEventListener(Event.DEACTIVATE, onDeactivate);
[Code].....
This function is present when I publish the CBT with Captivate, so obviously there must be code available. You can set the Captivate button to open url in new window and pause movie. Is there something I can add to the html file that is similar to the "has Priority" for mobile devices or is there javascript that can be added to the flash itself?
View 1 Replies
Feb 20, 2009
i've a problem with my setFocus. i will use [n] to identfy the line in the code. this is a MouseEvent.CLICK - function from an other dynamic,non-selectable textfield. the textfield in work is one with an embeded font and some text in it.if i use line [3], i'll get the no blinking courser and no possibility to enter some words. also if i mark some other and click after that in the input-textfield directly there will no courser anymore.but this only happens in the first time using the swf. if i first click into the input-textfield, then set the focus to something else and trying the steps i wrote over here, everything works fine.
View 7 Replies
Mar 9, 2010
I want to add a key listener to my stage, but from an object 2 depths below the stage. How would I do this?
I thought about adding the listener from my doc class, but the listener function is in the object that is two depths below the stage, which would mean I would have to pass the key values to the next movie clip, then when that one is loaded, pass it to the one with the listener function. It seems very complicated, is there an easier way which keeps with the principle of OOP?
View 21 Replies
Dec 8, 2009
I'm trying to add an event listener to my flash file using actionscript 2.0. what i'm tryin to do is this.
[Code]...
so whenever the user put the mouse over the stage the timeline should stop playing and onRollOut the timeline should continue.
View 1 Replies
Jul 27, 2010
I have a document class called "RheDocClass.as". This document class instantiates a class called "LiquidGui.as".What I want to do is have the LiquidGui class listen for stage RESIZE events and the act on those events. But when I try to add a stage listener to the LiquidGui constructor I get errors. ( the error depends on how I experiment with the syntax) So I have put the listener in the RheDocClass instead, and then pass the stage properties to the LiquidGui class. But, I'd really like to keep the stage resizing code all in the LiquidGui class so that I can reuse it with other projects.how I can attach a listener to the stage from the LiquidGui class?
View 9 Replies
Feb 27, 2009
I have a Enter_Frame listener to blend in a clip. The event is still running when my clip isn't on timeline anymore. How do I check that or how would I remove the Listener the best way?
View 2 Replies
Nov 13, 2010
I need to add an event listener to the stage of this code.. this is for a scrolling slider.. and if your mouse is not over the scroll bar area when you release.. the slider gets "stuck" to the cursor and it won't release. I believe I need to add a listener to the stage for the mouse up state so that if your cursor is elsewhere on the stage and you release the mouse, it will release the slider.[code]...
View 2 Replies
Apr 21, 2011
I have created a listener for stage in a function. The same function is called by another function.
Now I need to check with a condition that whether the stage listener is present or not.
HTML Code:
stage.addEventListener(MouseEvent.MOUSE_UP,stpdrg) if u r not clear with the question.
View 1 Replies
Jan 11, 2009
I have been playing with OOP concept... is it possible to add stage event listener from a custom class... I tried to access, stage.addEventListener(MouseEvent.Mouse_Move, mouseHL); in the constructor.. It shows error!
View 1 Replies
Mar 8, 2011
[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)
View 1 Replies
Oct 23, 2010
I have added a listener to the stage to close a loader object when the stage is clicked. The problem is the click seems to effect the loader object to (basically when you click the loader it calls the click function attached to the stage). Is that to be expected? I suppose it makes sense, but is there a way of adding a listener to the stage that excludes certain objects?
View 3 Replies
Jan 7, 2010
Can I add a ProgressEvent listener to the stage? I don't see it in any of the auto-complete options when I am typing in Flex. What do people normally do to get a progress readout of the entire main runner's loading progress? I try the following, which is where I would expect to see the ProgressEvent options pop up:
stage.addEventListener(
View 2 Replies
Aug 27, 2011
Why KeyboardEvent listener (AS3) does not react until I add it to the stage and not when I simply write it down in the Document Class just like I do with any other function? I mean, I have to write[code]...
View 1 Replies
May 8, 2011
exactly how do I add boundaries or some kind of listener to my stage? The size is:
x = 900
y = 900
im looking to end my game if the player moves beyond the screen area.
View 1 Replies