In ActionScript 3, can I detect when the user has clicked their back or forward hardware buttons on their mouse?
Doesn't look like it.
From what I can see you're able to work with:
Scroll wheel.
Middle click.
Left click.
Right click (AIR or Flash Player 11.2).
No, you can't. You can find a list of all supported events in the MouseEvent documentation.
Related
My movie has 3 frames, first one is the welcome screen with the play button, and after I press it and jumped to frame2 I have to click the movie for my character/player to respond and move by arrows. Same happens if I go back to frame2 from my game-over screen placed on frame3.
I use gotoAndPlay(); to navigate frames, naturally.
if it's something having to do with my code from frame2 i will post what it is required. I'd like to know why is that happening and how to fix it. THANKS!
Clicking your character gives it focus.
Only* what has focus receives keyboard events.
If you register the listener for the keyboard event on your character object, you have to click it first, before it receives those events.
However, the KeyboardEvents bubble up the display list and eventually reach the top most container which is the stage. This gives you two options:
Handle the focus yourself by assigning the object that should have focus to the stage.focus property. This is basically doing what the clicking does in your current situation.http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/Stage.html#focus
register your listeners at the stage
The user simply needs to click anywhere on the flash stage to add keyboard focus. Normally, a good way of achieving this is by using a start button, or something similar, for that first bit of mouse/keyboard focus.
I'm trying to make a button in AS3.0, and I want it to be activated ON CLICK, not ON RELEASE..
For now I have used "MouseEvent.CLICK" and what it basically does is that it activates the button after I'm releasing/taking off the finger from mouse. And I want it to be activating when I'm pressing on it.
I need this for the application on Android, the thing is that when I touch the button on the screen, it's not reacting UNTIL I take off my finger.
Thanks a lot in advance!
You need to use an event called MouseEvent.MOUSE_DOWN
I am trying to create an options menu for a game, where there are 2 buttons. One button is to disable all music, and the other is to disable all sound effects. When the button is clicked, it disappears with the .visible = false; code. The new button underneath is shown. When a person exits the game, I want the game to remember the settings, and which button is hidden.
Example: A person plays the game, but goes to options menu to disable sound. Sound is disabled, and the off button underneath is shown. The player exits the options menu, then exits the game. The player opens the game back up. The sound should still be disabled, and if the player goes to the options menu, the on button should still be invisible and the off button should be visible.
Could you please help me on how I can create this sort of system?
You should use 'SharedObject' class to store your data locally, then read it again on Startup.
See these examples as a start: example1, example2
I know that it's possible to let the user drag the content in a ScrollPane around using scrollDrag, so that they don't have to use the scrollbars. However, with scrollDrag, it only works for the left mouse button.
What I want to be able to do is pretty much the same, but for either the middle (mousewheel) or right mouse button. That way the user can use the left button for other functions.
Does anybody know of a feature I may have missed that can do this, or a custom method? Note that I don't want this, I just want scrollDrag with other mouse buttons.
I would like to put in my own graphics instead of the OS dependent boring scrollbars for the website I'm building. Is there a way to do this in GWT?
The best solution i found is to create my own scroll panel. The scroll bar is wrapped around a Focus panel. I've added Mousedown, mousemove and mouseout handlers to the focus panel. Recording the mouse movements and moving the contents accordingly.
I agree with Slaks. Best bet is to use the Jquery plugin JScrollpane.
http://www.kelvinluck.com/assets/jquery/jScrollPane/jScrollPane.html
I have posted my answer in fallowing link GWT CustomScrollPanel example. But this won't work for IE just like gmail.