ActionScript 3.0 :: How To Prevent Switching Focus
Mar 21, 2010
If I have a prompt window where I am asking the user for some input, is there some way I can prevent them from switching window focus to the other windows in my application? (switching to other applications is fine) I'd actually have preferred if the window didn't appear in the taskbar at all, but utility windows look awful and I'm using system chrome so lightweight is out.
I have a simple form that I'm building. It has a variable length list of entries, and I'm using a TextInput for each entry.
Because the list is variable in length, I'm allowing the user to delete elements from the list. One of the ways they can do this is to press the backspace key when the cursor is in an empty TextInput. I am handing KeyboardEvent.KEY_DOWN and checking for the backspace key, to accomplish this.
The problem I am having is that after I remove the deleted TextInput, I want to leave the focus in the TextInput above. I can do this using 'setFocus', and that works fine, however it seems that the backspace is still processing, and so after the focus is set, the content of the TextInput is delete which I don't want.
To get around this, I've created a one-shot timer with a 0ms delay which changes the focus after the KeyDown event has completed.
My workaround is successful, but feels very heavy handed. Is there a better way to achieve the same effect?
I have a web page where users can play flash games. We are now making some changes to the page which requires the games to be embedded with wmode=transparent or wmode=opaque so that we can show HTML elements on-top of the flash games. The problem is that in Internet Explorer (on all versions) the whole page scrolls if a user presses the up/down arrow keys. I've tried everything I can think of and I've spent a whole day searching for a solution without success.o far I've tried putting the game inside a iframe and I tried disabling the up/down keys with JS, none of which solves my problem.
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?
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)
i am trying to make it so the weapons will switch when i press the a,b,c,d,e button on the keyboard( i will figure out the actual button l8r) i have made a mc clip button to make it switch which works but i cant figure out how to do it from the key board
i have an rtmp folder with videos,I am trying to do a seamless change to next video using nestsream play2 method.have tried using the fast switching of NetStreamPlayTransitions. SWITCH like below.[code]The problem is the switching is not happening.offset=-1 is supposed to be fast switching. The idea is to make a seamless transition to the next video.if we dont use any transition method or use opts.transition = NetStreamPlayTransitions.RESET;its the same as not using any. It just switches normally.RTMP is supposed to provide a relatively faster transition, i am looking for a seamless option .
I am using the following line of code in my Flash movie: navigateToURL(request,"_blank");However, when I am using Internet Explorer 7 (with tabbed browsing enabled), and this code is called to open a link, the link is opened in a new tab, but IE7 does not switch you to view that tab as you would expect!When I open a link in a normal web page in IE7 (and the link opens in a new tab because _blank was specified in the HTML code for that link), IE7 will switch you to that new tab to see the web page you just opened, so why does it not happen when using Flash?I know that within the settings for IE7, there is a setting that you can tick that says, Always switch to new tabs when they are created, and this solves the problem. However, many web site visitors will not have this ticked.How can I make sure that when a user opens a link in a new tab from my Flash movie, IE7 switches to that tab?I am using ActionScript 3.0 and Flash CS4.
Let me preface this post by saying I have been studying actionscript 3 for 2 months now and I am now at a point where I am looking into how experienced developers code their projects and what tools they are using. Repeatedly, I come across a post or a blog entry where a developer says:
[Code]...
Now here comes my confusion/question(s). When a developer says something like that, are they saying that they ONLY use FDT to create their projects? If so then how are they going about doing it without the use of the Flash IDE? Do they just keep creating external .as classes and then link them all together or what?
In my 2 months of studying, I really feel like I have learned a lot, but I cannot seem to wrap my head around this. I want to break away from the Flash IDE (if at all possible) so that I can go deeper to the code.
I'm making a website for my business. I want this site to run similar to an OS UI. The first issue I've run into is swapping between "window" MC depths. I'm not quite sure if its just that I need to add a mathematical variable to each one every time it is clicked or how to getDepth of the highest "window" MC in order to put the desired "window" MC above it.
You can download the .fla file <a href="www.dpr.150m.com/images/index.fla">here</a>.
I just try to work on a document and need to draw something with my graphic tablet, but everytime I switch from mouse to graphic tablet, Flash crashes immediately.Is there any way to make it work WITH the tablet?! I remeber it worked once, but now it's pretty f**ed up.
Need to design a flash video player which can run multiple angles of video at the same time. The primary video will run at full size, and the other angles will run at a much smaller sample size at the bottom of the video. User will then be able to select whichever angle of video he likes and upon clicking the smaller video it will become full screen/mainplayer shell. The video which was previously full screen will then take its place among the other smaller videos.
I've been having a problem with an interactive Flash CS5 project: when I navigate between frames using gotoAndStop(1); the program experiences the following error: Error #1009: Cannot access a property or method of a null object reference. I think this is because the first frame that the function goes to has none of the objects that have event listeners in frame 2. All I'm hoping to do is go back to the first frame. Would it be best to put everything on one frame and work from there? That seems unneccessarily complicated.
I've coded a little game, but now I realized that I should include all the actions to frame on layer called "actions". This far I've written my code to movieclip.transforming this to frame?
I've done a lot of Flash development and have been meaning to try out canvas for a while, but after browsing through some tutorials, I can't understand how this is supposed to replace Flash.
Note: I ask a lot of questions down here. I don't really expect them all to be answered. What I'm really looking for is some basic guidance about how I should be thinking while developing on <canvas>.
From the spec, it looks like <canvas> is really more analogous to the Graphics class in Flash, which one would use something like this:
class ColoredCircle extends Sprite { private var _color:uint=0x0; public function ColoredCircle(color:uint) {
[Code].....
Should I be treating <canvas> like a Sprite? Marking everything as position:relative should allow me to basically duplicate display list-type behavior (I don't believe that you can nest <canvas> elements, but you could probably do so by throwing in a bunch of <div>s). However, I use a lot of Sprites in my projects. That's going to be a metric crap-ton of tiny canvas elements. Also, how do you handle mouse events in <canvas>? Do they trigger if someone clicks on a transparent part of the canvas's box model (bad)? If I have a canvas with two circles in it and I need to know which one gets clicked on, do I have to do bounds-math with the mouse position?
Suppose I have one combo box and I am switching its data provider from oldDataProvider to newDataProvider with ActionScript. Both data providers are ArrayCollections. Then, when a change occurs in the oldDataProvider ArrayCollection, it affects the combo box, although it is not its data provider anymore. Specifically, when removing an item from oldDataProvider (in the range of the newDataProvider values), it decreases the selectedIndex value of the combo box by one, changing the selected item.
It sounds super easy, but I don't know where to start. What I want is to have some buttons on the stage, and a mc to load some content related to the buttons. the content is in the library and is exported for actionscript. I want the content to fade in and out when you click a new button without leaving the page. Is this going to be an if then statement, switch statement, for loop?
I'm using Flash CS5 Components in an App. I want to allow the user to tab around.
I want a modal popup window to show and for the tab loop to switch from the main UI to the modal window UI.
Using FocusMangers should allow me to do this but I'm struggling to get anything working. The tabbing continues back out to the main UI instead of sticking in the window.
I'm importing external SWF's into the main file/stage.These SWF's contain an embedded Youtube video.The code Youtube player:
ActionScript Code: // The player SWF file on youtube.com needs to communicate with your host // SWF file. Your code must call Security.allowDomain() to allow this // communication.
[cod]....
when I click a second button to import a next SWF, the current SWF disappaers but I can still hear the video playing. When I start the newly imported SWF, I hear the 'removed' SWF playing + at the same time I see & hear the new imported one?It does work properly when I first stop/pause the current SWF, before importing the next one ... but this process should be automatic.
I am working on a side scroller. The point is to collect 10 coins, and on that event, a door will open. I need to make it so when the character HitTest the door, while dooropen = 1 to go to the scene 2 and play it. Here is the code I have.
onClipEvent(load){ var dooropen: Number = 0; } onClipEvent(enterFrame){
i have an rtmp folder with videos,I am trying to do a seamless change to next video using nestsream play2 method. have tried using the fast switching of NetStreamPlayTransitions.SWITCH like below.
ActionScript Code: private var FName:Array = ["1av.flv","2av.flv","3av.flv","4av.flv","5av.flv"]; private var opts:NetStreamPlayOptions = new NetStreamPlayOptions(); // on init of net connection
[code]....
The problem is the switching is not happening.offset=-1 is supposed to be fast switching. make a seamless transition to the next video. if we dont use any transition method or use
I've created a function that plays a number of loops and transitions in a specific order which is this: Loop1 > Trans1 > Loop2 > Trans2 > Loop3 > Trans3 > Loop3..Now, the last loop (loop3) is supposed to play infinite after trans3 has finished, but that doesn't work. (This is the goLoop function )So, basically, what I want to do is to have a button that switches the currently playing loop to the next one, and between them should the transition play automatically.
I've coded a little game, but now I realized that I should include all the actions to frame on layer called "actions". This far I've written my code to movieclip.