|
-
Señor Member
How to prevent switching focus
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.
Any help is appreciated.
Haikus are easy
But sometimes they don't make sense
Refrigerator
-
Flash/Flex Developer
What I do it have my windows open using the PopUpManager. Setting the window to modal will force the user to close that window before returning to my application.
Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.
-
Señor Member
We-ell, I'm using flash so unfortunately I don't have that luxury... is there any way to implement something similar in Flash CS4? *hopeful smile*
Haikus are easy
But sometimes they don't make sense
Refrigerator
-
Señor Member
If you still have an alternative, that would be great, but for now I've found a kindof crappy workaround. It works well enough. Basically:
-minimize all non essential windows (all but one in my case, making the rest visible = false)
-set alwaysInFront to true
-listen for activate and deactivate events on the application. On deactivate, set alwaysInFront of the popup to false. This sends it to the back. On activate, do the opposite.
-listen for a state changing event from the window remaining in the taskbar. Cancel the event and set alwaysInFront to true and activate it.
-when the popup is closed by the user, activate/ set visible the other windows.
Haikus are easy
But sometimes they don't make sense
Refrigerator
-
Flash/Flex Developer
I was going to suggest something very similar. I've used a sort of hack to get around this problem, which I think works.
What I do is when I have the fake modal window open, I draw a box directly behind it that is the same size as the stage. I don't place any listener on it but it filters out any contact with the elements on the page below. I also add a tint to it, so I'm not hiding the background. When the modal window closes, so does the filter window. I've used that more often than I like to say, because it is easy to deal with.
Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.
-
Señor Member
Well I just started working on this again... and it turns out that what I've done doesn't really work. Someone on another forum mentioned that you can disable all mouse and keyboard interactivity to windows and disable menu items so that the window can't get focus. I haven't found a way to do this from reading the documentation... can anyone help me out?
Also... if you feel so inclined, you can vote for the suggestion here so that it might get added into AIR 2.0
Haikus are easy
But sometimes they don't make sense
Refrigerator
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|