ActionScript 3.0 :: Test For MouseOver AND CTRL Key Down?
Dec 8, 2010How do I test for MouseOver AND the "CTRL" key being pressed at the same time?
View 8 RepliesHow do I test for MouseOver AND the "CTRL" key being pressed at the same time?
View 8 RepliesThe flashplayer catches all keys pressed by the user. I'd like to know if there's a way or workaround to pass them to the browser. For instance, Ctrl-T (open new tab in firefox). I'd like to re-enable this shortcut. Maybe with javascript?
View 1 RepliesIn the stage I have a MC called test. In this MC I have another MC called sub.
on MOUSE_OVER the test.sub should be visible and i want to be able to go to it and for example click it... but when I leave the shape it disappears before i reach it. I attached my test fla
When I test a flash file by hitting "ctrl+Enter" it creates a .swf in same directory as my .fla. does the resulting .swf file actually use the selected publish settings of my .fla file? Or when creating an .swf by "ctrl+enter" does it only use a "default" setting?
View 3 RepliesI have a Flash movie which fills the whole browser window. This means that always the key events are catched ("stolen") by the Flash movie only, when using Firefox. IE7 seems to be working as I want.
I want for example ctrl+w (close window), ctrl+n (new window), ctrl+t (new tab) to work in Firefox while the focus is on my Flash movie. How to accomplish this?
I'm tracking the keyUp state of the CTRL key and I'm okay with the results except when it comes to key combinations. The code I wrote below is for you to see what the issue is.
Press the CTRL/Apple key and you'll see it traces "CTRL on". Release it and you'll see it traces "CTRL off". No problem there. Now press CTRL and then press the A key (as in select all), now release A, then release the CTRL key and you see nothing traces. Does anybody have an idea about a workaround to that? I prefer not to use a continuous ENTER_FRAME hack for that if any.
[Code]...
How to disable Ctrl+W or Ctrl+C and Tab for .swf file
ctrlKey = false; in KeyBoardEvents but how to apply it to the stage.
I have a basic mouseover in my flex application which changes an image onmouseover and changes it back onmouseout using the code mouse Over "functionToChangeImageSource()" and another one to mouseout.It works fine when you slowly mouse over and out, however if I quickly move the mouse over it, it occasionally stays on the mouseover image and the mouseout function doesnt appear to kick in. Is there anything I can do to fix this, or does anyone have any ideas why its happening?Also, I've tried the rollOver and rollOut instead but it has the same problem.[code]I'd imagine you're correct about the mouseover event not completing before mouseout is but how to I fix this?
View 3 RepliesI have a simple movie clip for which i bind two events 1-MouseOver and MouseOut
in these events i am just tracing simple text
But the Problem is when i take my mouse over the movie clip both events called tracing the string in the output panel
Infact, things should be done like that on mouse over, its text is printed and when i take my mouse away[out] from the movieClip MouseOut event should be called.
ActionScript Code:
import fl.motion.Color;
import flash.display.MovieClip;
[Code]....
I'm trying to test a custom Flex 4 skinnable component, using the FlexUnit UIImpersonator class. If I run my tests from a FlashBuilder Spark only project everything works fine. If I try to test from a project with the mx component set on the classpath I get a "getElementIndex not available in non Flex 4 projects" error.Can I unit test spark components in FlexUnits visual test environment while still having the mx component set on the classpath?
UIImpersonator delegates it's method calls to a "testEnvironment".The implementation used for this "testEnvironment" is decided by the VisualTest EnvironmentBuilder class and the FlexEnvironmentBuilder class. If the FlexEnvironmentBuilder class can find the "mx.core.Container" on the classpath it returns a MX environment, else a Spark environment. Only the spark environment has valid implementations for Flex 4 relevant method calls on the UIImpersonator - like the addElement method.
My buttons only work when I click on them on the stage while having the "enable simple buttons" option on. They do not work if I try to "test movie," "test scene" and publish it to a SWF. Nothing responds whenever I am in these modes. I am using Adobe Flash Professional CS5 Actionscript 2.0.
This is the code that I put in for the buttons:
[Code].....
i have a movie that has worked fine in past during Html test but ive been doing some dubugging using the flash test latly and it runs fine here but when i go back and try to test in Html mode no errors come just the movie never fully starts (starts up about as much as if there was an error).
View 5 RepliesI have two scenes in my flash file and in scene 1, first button takes you to frame 2 where movie clip is -works
on (release) {
gotoAndStop("scene1",2);
}
second button takes you to frame 3
but on scene 2 that performs same function as scene 1, the first button
on(press){
gotoAndStop("scene2",2);
}
instead of going to frame 2 goes to frame 3. and the second button goes correctly to frame 3.that happens when i test scene! when i test movie all buttons work properly.
In FlexUnit 1 it is possible to access the name of the currently-running test using the TestCase.getName() method because all tests subclass TestCase. In FlexUnit 4, however, there's no base class for tests; the tests are identified by annotations. So, how can I replicate the getName() functionality in FlexUnit 4?
View 2 RepliesI have been using the up/down, left right keys ito scale and rotate an object. I decided to change that to CTRL+up/down/left/right key so I could use the arrows to position the object.
When I change
if( event.keyCode == Keyboard.UP)
to
if( event.keyCode == Keyboard.UP && event.ctrlKey)
nothing happens.
I've tried a few tests and I can CTRL+left and CTRL+right fires an event, but CTRL+Up or CTRL+Down does not fire an event.
without the && event.ctrlKey added, all events work fine. So I knopw the CTRL key works and the arrows work. Just not CTRL+UP or CTRL+DOWN arrow together.
It might be my DELL laptop keyboard, but if so, many will have this problem.
I am not able to detect the keyboard event CTRL+V on a swf using AS3 in IE. It seems to trigger the default browser behavior, and im not able to do anything.
View 2 RepliesI want to be able to capture Ctrl + another key. How do I do this?
I've got the following code from help:
var keyListener:Object = new Object();
keyListener.onKeyDown = function()
{
[Code]....
But I can't seem to be able to capture key combinations like Ctrl + another key.
For what I need to do, I really need to capture several key combinations. At the very least, I want to be able to capture Ctrl + another key.
I have a switch statment in my action script class. I have a function onKeyDown (event: KeyboardEvent) which contain a switch statement.which control the different keys. But now I want to handle the same functionality which TAB key is doing using two keys CTRL and SPACE key. I want add a case more in my switch statement first I pressed CTRL and then SPACE key then a a specific funtion is called. How two keys used in my switch statement.......
private function onKeyDown(event: KeyboardEvent) : void{
if (popUp.displayPopUp){
switch (event.keyCode){
case Keyboard.UP:
case Keyboard.DOWN:
[Code] .....
I'm having a strange issue regarding the ctrlKey. Maybe somebody can help me sort this out.
In this code, when I press the "X" key the SomeFunction executes just fine.
[Code]...
Me and my friends have done a game and when we export it you can scroll through the whole game by pressing Ctrl + Enter. How can we block Ctrl+Enter from skipping frames?
View 13 RepliesIn my application, I need to detect a CTRL-C event. I can detect CTRL-K , CTRL-T , CTRL-U, and a bunch of others, but it seems that CTRL-C is reserved ! First it detects the CTRL , but as long as the CTRL button is held down, it totally ignores C when it's pressed. I know that there was a key combination detection script here on kirupa offered by someone (Michael), but it has this problem as well. how I can detect this combination?? Here is the code Im using to test which key is being detected (Note that debug is the variable name of a textfield on the main timeline, because testing key combination events inside of flash sometimes causes problems):
[Code]...
I am writing an AIR application in Flex. The application needs to be able to handle shortcuts on both Mac and Windows. I have the shortcuts on the Windows side working, but the same application on a Mac doesnt seem to trigger the commandKey property on a Keyboard event when the user is also using another key in combination (ex. command+g doesnt work)
View 2 RepliesI want my data grid to behave by default as if the user is holding the control key down. So when an item is clicked, then another item they are both part of the selection, clicking them again removes them from the selection. I already have allowMultipleSelection = true but I can't seem to find any setting that does this. I'm working on the itemclick event in the meantime, but it seems like there might be an easy to use setting I'm missing.
View 3 RepliesI'm using hotkeys (ctrl + key) in my flex application. getting problem when my app is running in IE.when i press ctrl+D, im getting 'Add a Favorite' window of iE.How should i override the default behaviour of the browser.
View 1 RepliesWhen a flash app is loaded in the browser, it default captures the CTRL-TAB keystroke which is needed for changes tabs in modern browsers.
Any ideas on how to configure Flash Builder 4 to not listen for these keystrokes or to bubble them up to the browser?
I need to disable pasting text in a textinout (flex3) : CTRL+V
View 2 RepliesI need to fire an event by pressing CTRL+s.
I tried this but it won't work:
if(e.ctrlKey == true && e.keyCode == 81){
trace("CTRL+S")
}
I am trying to perform an action with Ctrl+Click So, when a textfield is clicked, I would like to check to see if the user has the Ctrl key pressed as well, if it isn't pressed ignore the click action otherwise do the action...
View 4 RepliesI've been looking for a way to diable the ALT key or disable a user exiting my flash movie through ctrl-alt-delete. I've searched around online and all that i've found is this: fscommand("trapallkeys", "true"); it works good for some keys, but not what I'm looking for. Everything else is just for old AS. I need this for Mx.
View 1 RepliesMe and my friends have done a game and when we export it you can scroll through the whole game by pressing Ctrl + Enter.So my question i simple: How can we block Ctrl+Enter from skipping frames??
View 14 Replies