Dispatch loaded clip's keyboard event with parent's mouse click

Hi. I'm building a swf wrapper which loads third-party swf games. The client would like a button in the wrapper which will dispatch a keyboard event in the loaded swf.
Can anyone give me hand on how to construct a dispatch event in the wrapper that reaches into the loaded swf?
Many thanks!

after loading is complete:
MovieClip(yourloader.content).dispatchEvent(new KeyboardEvent(somekeyboardevent));   // if the loaded swf is a movieclip

Similar Messages

  • I made a movie in iMovie then deleted the clips in it. I have reimported the clips in an event with the same name as previously and some clips in the movie are still saying source slip missing even though they are there. What can I do?

    I made a movie in iMovie then deleted the clips in it. I have reimported the clips in an event with the same name as previously and some clips in the movie are still saying source slip missing even though they are there. Some clips are fine in the movie, but most are just black and when I hover over them, it says source clip missing. How to I fix this? Thank You

    I did that too, then I did a migration assistant to a new Mac and ALL of my movies have Source Clip Missing now, even though the original clips are still in the iPhoto Videos.  I can stand to re edit one or two projects, but not ALL.

  • Event Handlers of a mouse click

    In the simplest way possible please tell me how to do an event handler for a mouse click.
    private int clickCounter = 0;
    private void MyCanvas_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
    if (Device1RB.IsChecked == true)
    clickCounter++;
    return;
    else if (RemoveRB.IsChecked == true)
    clickCounter--;
    return;
    else
    return;
    private void Switch_class()
    switch (clickCounter)
    case 1:
    //code here
    break;
    case 2:
    //code here
    break;
    case 3:
    //code here
    break;
    case 4:
    //code here
    break;
    case 5:
    //code here
    break;
    default:
    //code here??
    break;
    This is what I have and I apparently need an event handler for the mouse click. Also if there is an easier way to do what I want then please point me in the right direction.

    I still can't figure out why its not working.
    private int clickCounter = 0;
    private void MyCanvas_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
    if (Device1RB.IsChecked == true)
    clickCounter++;
    return;
    else if (RemoveRB.IsChecked == true)
    clickCounter--;
    return;
    else
    return;
    private void Switch_class()
    switch (clickCounter)
    case 1:
    pic_1.Visibility = System.Windows.Visibility.Visible;
    break;
    case 2:
    pic_2.Visibility = System.Windows.Visibility.Visible;
    break;
    case 3:
    pic_3.Visibility = System.Windows.Visibility.Visible;
    break;
    case 4:
    pic_4.Visibility = System.Windows.Visibility.Visible;
    break;
    case 5:
    pic_5.Visibility = System.Windows.Visibility.Visible;
    break;
    default:
    //code here??
    break;
    That's what I've got.
    <Canvas x:Name="MyCanvas" HorizontalAlignment="Left" Height="391" Margin="130,20,0,0" VerticalAlignment="Top" Width="520" MouseLeftButtonDown="MyCanvas_MouseLeftButtonDown" Background="Transparent">
    <Rectangle Fill="White" HorizontalAlignment="Left" Height="391" Stroke="Black" VerticalAlignment="Top" Width="520"/>
    <Image HorizontalAlignment="Left" Height="34" VerticalAlignment="Top" Width="100" Source="Power.png" Visibility="Visible"/>
    <Image x:Name="pic_1" Height="42" Canvas.Left="152" Canvas.Top="70" Width="44" Source="2box.png" Visibility="Hidden"/>
    <Image x:Name="pic_2" Height="42" Canvas.Left="152" Canvas.Top="70" Width="44" Source="2box.png" Visibility="Hidden"/>
    <Image x:Name="pic_3" Height="42" Canvas.Left="152" Canvas.Top="70" Width="44" Source="2box.png" Visibility="Hidden"/>
    <Image x:Name="pic_4" Height="42" Canvas.Left="152" Canvas.Top="70" Width="44" Source="2box.png" Visibility="Hidden"/>
    <Image x:Name="pic_5" Height="42" Canvas.Left="152" Canvas.Top="70" Width="44" Source="2box.png" Visibility="Hidden"/>
    </Canvas>
    This is the canvas...Is there something blatantly obvious that I'm missing?

  • When I use Mail and want to paste an emailadress with a right mouse click in the adres field this doesn't work, ofcourse cmd V  works. How can I solve this

    when I use Mail and want to paste an emailadress with a right mouse click in the adres field this doesn't work, ofcourse cmd V  works. How can I solve this

    YAY!  That did it.
    Thank you so much.
    And a Very Happy and Prosperous New Year to you!
    bonnie

  • Firefox 9.0.1 with Flash player not catch keyboard event with mouse click.

    In a flash application, I need select mutil items using shite key and mouse click, it is not working. looks like firefox didn't pass the keyboard even alone with the click event. This happen on Window 7, IE and Chrome have no problem. only FF

    i have the same problem everytime i open a website with flashcontent firefox freezes and i have to kill the flash process to unfreeze the browser the only way i can see a youtube video is in html5 mode.
    Hardware
    Acer aspire 4553
    Turion X2 p520
    3gb of ddr3 ram
    Ati Mobility Radeon 4250

  • Getting keyboard events with Group

    Hi all,
    I'm new to JavaFX and I'm trying to handle keyboard events in a group but it doesn't seem to respond when I press the keyboard.
    As I understand this is because Group doesn't receive the focus. If that is the case, how can I make it receive focus? I tried calling setFocusTraversable(true) and setFocused(true) but both haven't helped.
    If it's not the focus, what is it?
    Thanks!

    Use requestFocus() instead of  setFocused(true).
    Keyboards events work as expected  with a group.
    @Override
        public void start(Stage primaryStage) {
            Button btn = new Button();
            btn.setText("Say 'Hello World'");
            Group root = new Group();
            root.addEventFilter(KeyEvent.KEY_PRESSED, new EventHandler<KeyEvent>() {
                public void handle(KeyEvent event) {
                    System.out.println(event.getCode());
                    event.consume();
            root.getChildren().add(btn);
            Scene scene = new Scene(root, 300, 250);
            primaryStage.setTitle("Hello World!");
            primaryStage.setScene(scene);
            primaryStage.show();
            root.requestFocus();

  • Code 41 Error when installing my HID keyboard driver with my HID mouse driver

    I am developing a HID keyboard driver and a HID mouse driver based on HIDUSBFX2 sample code.
    So I added some lines as below into both keyboard driver inf file and mouse driver inf file.
    ;-------------- Service installation
    [hidKeyboard_Device.NT.Services]
    AddService = hidKeyboard,, hidKeyboard_Service_Inst
    AddService = mshidkmdf,0x000001fa, mshidkmdf_Service_Inst
    ; -------------- hidKeyboard driver install sections
    [hidKeyboard_Service_Inst]
    DisplayName    = %hidKeyboard.SVCDESC%
    ServiceType    = 1               ; SERVICE_KERNEL_DRIVER
    StartType      = 3               ; SERVICE_DEMAND_START
    ErrorControl   = 1               ; SERVICE_ERROR_NORMAL
    ServiceBinary  = %12%\hidKeyboard.sys
    ; -------------- mshidkmdf driver install sections
    [mshidkmdf_Service_Inst]
    DisplayName    = %mshidkmdf.SVCDESC%
    ServiceType    = 1                  ; SERVICE_KERNEL_DRIVER
    StartType      = 3                  ; SERVICE_DEMAND_START
    ErrorControl   = 1                  ; SERVICE_ERROR_NORMAL
    ServiceBinary  = %10%\System32\Drivers\mshidkmdf.sys
    LoadOrderGroup = Base
    [hidKeyboard_Parameters.AddReg]
    HKR,,"LowerFilters",0x00010000,"hidKeyboard"
    I installed my HID mouse driver first successfully.
    And then I tried to install my HID keyboard driver. But the installation was failed with error code 41.
    Windows successfully loaded the device driver for this hardware but cannot find the hardware device. (Code 41)
    When I checked mshidkmdf service registry, I can find that Owners value is "oem6.inf, oem5.inf"
    oem6.inf - keyboard driver inf file, oem5.inf - mouse driver inf file
    And when I checked the log with traceview, keyboard driver was not able to receive any IRP from HID class.
    On the other hand, mouse driver received the IRP and reinstalled.
    * If I uninstall the mouse driver and then install it again, the driver is installed successfully. I mean that this issue was found when first installation.
    Please help me~

    if you are filtering below the hid miniport, why do you have separate keyboard and mouse infs? For a filter below the miniport just use one inf and the filter will see both the keyboard and mouse requests (assuming you report a keyboard and mouse TLCs
    in the hid descriptor)
    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

  • Datagrid change row event with tab AND/OR click ???

    I have a spark datagrid with the last two columns enterable.
    The natural approach for the user is to click in one and enter it then keep tabbing from cell to cell row to row to do his/her data entry.
    Selectionchanging works only if you click, the selection does not keep up with the tab from row to row.
    I want to enter the new data for each row when the user leaves the row.
    What is the best way to approach this particular (and common) need.
    Thanks
    Dan Pride

    Hi again,
    I think I was not clear enough. Basically I have a textfield assigned with a style, let's say TextFieldStyle1. What I want is to programmatically assign the textfield another style, say, TextFieldStyle2.
    How can I achieve that ?
    Many thanks !

  • No KeyDown detected on a new Window presented with ShowDialog (a mouse click is required before working)

    Hello,
    I shorter the code.
    In MainWindow I have a button to open a SecondWindow 
    private void ButtonNextWindow_Click(object sender, RoutedEventArgs e)
                WindowState = WindowState.Minimized;
                var secondWindow = new SecondWindow();
                secondWindow.ShowDialog();
                WindowState = WindowState.Normal;
    In the second window class I declared a KeyDown event called onKeyDown
    private void onKeyDown(object sender, KeyEventArgs e)
                MessageBox.Show("Key Pressed");
    well... it works only if I first click in the Second Window with the mouse, wherever I want.
    I would avoid this click; seems something related with the Keyboard focus.
    Thanks in advance,
    Vincenzo

    Set second window to focus after you set first window state to normal
    private void ButtonNextWindow_Click(object sender, RoutedEventArgs e)
                WindowState = WindowState.Minimized;
                var secondWindow = new SecondWindow();
                secondWindow.ShowDialog();
                WindowState = WindowState.Normal;
    secondWindow.Focus();

  • Wanna kill your wireless modem and function key with a few mouse clicks?

    Toshi satallite 675D, 3gHz 4meg ram, doze 7
    All you have to do is go to msconfig and disable all start up apps except the touch pad and hit restart. This is immediately after the second in two days 2 hour recovery which fixes the problem. After watching while all the flab gets reinstalled and upon rebooting, I checked the fn key, its working. I went straight to msconfig and did what I described above checking the fn key while the restart choice is waiting.... it's working. After restart fn key and all the F keys at the top of the keyboard are dead and the wireless modem is also dead. Even tho the modem light is on.  I go back to msconfig and enable all startup apps  to no avail. I type in flash and restart the flash cards and it actually worked ONCE. I disable again as above and restart and every thing is dead again like before only now it's another two hours of reloading crap I don't need to get this other crap I don't need to work again. Surely...... there is a better way to turn the coffee shop modem on and off. What is it please? If this is the best toshi can do with a marketing device they are in trouble.
    Ron
    Satellite 675D Win 7 premi, used primarily for audio applications and enough browsing for tech support and updates.

    Was there something wrong with my question? Was it too long? What? Did I forget to fawn all over toshiba?
    I'm not real pleased with toshiba at the present. 
    Ron
    Satellite 675D Win 7 premi, used primarily for audio applications and enough browsing for tech support and updates.

  • Issues with "wait until mouse click"

    when I put wait until mouse click it doesn't register mouse down or mouse up. Because of that, my game is sloppy and skips some scenes if I accidentally hold down my mouse for more than a split-second click. Is there any way to manipulate the wait for mouse click behavior so it works only when the mouse button is released?

    Hmm, I wonder if he figured it out already, since he didn't even answer your question.  He seems to be talking about the built-in "Wait for Mouse Click or Key Press" behavior in the behavior library.  Sometimes those behaviors can become overly complicated for the simplest of things.  I recommend you just go ahead and roll your own frame script, as EtchK was implying.  It's pretty easy, you just need two short handlers:
    on exitFrame
      go to the frame
    end
    on mouseUp
    -- do whatever
    end

  • No keyboard Events on a Window

    Hello Java community,
    I can't understand why, if you build a simple Window (not a Frame), all keyboard Events are simply ignored !! Everything acts as if the Window can't get the focus, because no LOST_ or GOT_ FOCUS events are triggered. This means that you can't handle keyboard events with a Window and therefore a Textfield will not work (however it still receive mouse events ??). BUT it perfectly works with a Frame , which extends from Window! Strange isn't it ?
    I've heard on other forums that , to be eligible for focus a Window must have:
    - its owner Frame (the one given in the constructor) :
    * displayed on screen,
    * containing a focusable component.
    - itself, containing a focusable component.
    thus i respect theses limitations, i still can't get any keyboard events
    pleaze help, i am writing a text area component and without keyboard events ...

    Thanks for the answers BUT,
    I have already read the javadoc in every ways and I am sure I respect perfectly all the conditions to have my WINDOW focusable.
    No, there is another problem, a strange one. In fact, my program works fine under Windows I can type characters into my Textfields but once executed under Linux : no keyboard events! Therefore, no character type allowed. I display in the console, all events that are incomming into my Window, and ALL events are ok (mouse, windows..) except keyboards ones. When I press a key, nothing appears in my console, that's why I think keyboards events are caught and not dispatched to the Window.
    I noticed an interresting fact when using my app in Applet. For example, I launched my application with Mozilla (Netscape 4, JRE 1.1). I displayed an empty Window on screen, when my mouse passes over it or when I click, the Java console showed me these events. When I try to hit some keyboard keys, nothing except for certain keys such as F, G, D, J and numeric keys. In fact, these keys are shortcuts to some of the System class (F calls Finalization, G=Garbage Collector, D=Debug Mode...). I truely think that on a Window, all keyboard events are send to the console. Another fact that proved me that i was right : I tried my app with JRE 1.2, and when I wanted to type characters into my TextField (which is on my Window), the typed characters appeared in the console !!!!
    A JAVA-experimented person told me to redirect the standard input to my own inputStream... but how ?
    Any ideas of solutions ?

  • In Flashplayer, I can crossover mouse and keyboard events. In IrfanView I cannot. Can this be fixed?

    My client uses IrfanView to play SWF files. Unfortunately, he does not use Flashplayer. In Flashplayer, I can crossover mouse and keyboard events with no problem. In IrfanView, the second I click a button, the keyboard events are disabled. Is there a fix?

    Hi Ned. I may have posted this issue a bit early, but this problem is also happening in Flashplayer 10. It's not exclusive to IrfanView.
    Here is something that I encountered during my testing, when I jump to scene 6 using the menu button, I have a play button to jump from one frame to the next frame that stops -- the keyboard events start working. But if all I am doing is jumping scene to scene with the mouse button, the keyboard events are disabled.
    I feel as if the keyboard events only work if I am playing frames in the scene. And if all I am doing is jumping scene to scene using the buttons, the keys will disable.
    I set up the mouse buttons inside a movieclip that all the scenes share. The mouse actionscript is in the movieclip. On the main timeline of each scene is an actionscript for the keyboard events, even though I had to change each function name.
    I feel the actionscript is setup pretty simple. I just wish clicking the buttons would not disable the keyboard events. This may sound redundant, but the keyboard events do the same thing if you use the mouse buttons. It's just preference for the client even though he will need to understand that using the mouse buttons override the keyboard events. He doesn't really lose functionality.
    Keyboard actionscripting below:
    import flash.events.KeyboardEvent;
    stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyEvent);
    function onKeyEvent(e:KeyboardEvent):void {
    var character:String=String.fromCharCode(e.charCode);
    if (e.keyCode==72) {
      gotoAndStop(1,"master");
    if (e.charCode==49) {
      gotoAndPlay(1,"Distributor");
    if (e.charCode==50) {
      gotoAndPlay(1,"Mirka");
    if (e.charCode==51) {
      gotoAndPlay(1,"Farm");
    if (e.charCode==52) {
      gotoAndPlay(1,"Check2");
    if (e.charCode==53) {
      gotoAndPlay(1,"Check3");
    if (e.charCode==54) {
      gotoAndPlay(1,"Scene2");
    if (e.charCode==55) {
      gotoAndPlay(1,"Scene1");

  • [SOLVED] PgUp/PgDown Improperly Spawn Two Keyboard Events

    After doing an upgrade (pacman -Syu), I can no longer use the following keys on my keyboard without unappreciated consequences:
    - PgUp
    - PgDown
    - now, apparently, the Left arrow
    When I use xev, I get two separate events for every one real keyboard event, with two keycodes.
    For example, this is what happens when I press PgUp:
    KeyPress event, serial 24, synthetic NO, window 0x1800001,
    root 0xae, subw 0x0, time 1850204, (679,556), root:(680,571),
    state 0x0, keycode 112 (keysym 0xffaf, KP_Divide), same_screen YES,
    XLookupString gives 1 bytes: (2f) "/"
    XmbLookupString gives 1 bytes: (2f) "/"
    XFilterEvent returns: False
    KeyPress event, serial 24, synthetic NO, window 0x1800001,
    root 0xae, subw 0x0, time 1850204, (679,556), root:(680,571),
    state 0x0, keycode 99 (keysym 0xff55, Prior), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False
    MappingNotify event, serial 27, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 8, count 248
    KeyRelease event, serial 27, synthetic NO, window 0x1800001,
    root 0xae, subw 0x0, time 1850306, (679,556), root:(680,571),
    state 0x0, keycode 112 (keysym 0xffaf, KP_Divide), same_screen YES,
    XLookupString gives 1 bytes: (2f) "/"
    XFilterEvent returns: False
    MappingNotify event, serial 27, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 8, count 248
    KeyRelease event, serial 27, synthetic NO, window 0x1800001,
    root 0xae, subw 0x0, time 1850306, (679,556), root:(680,571),
    state 0x0, keycode 99 (keysym 0xff55, Prior), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False
    I've checked xmodmap -pke, but I have no idea what it means:
    keycode 99 = Prior NoSymbol Prior
    keycode 112 = KP_Divide XF86_Ungrab KP_Divide XF86_Ungrab
    Any help would be appreciated. Needless to say, this is pretty annoying when I'm trying to edit code and it searches my document instead of scrolling up, or capitalizes words (some vim feature I had previously never known about, and will most likely never use).
    Last edited by secretrobotron (2010-06-24 15:09:05)

    I'm pretty sure I'm using the latest xorg. I installed a fresh version of arch a couple months ago.
    My xorg.conf has about six lines concerning keyboards, most of which are
    Section "InputDevice"
    Identifier "Keyboard0"
    Driver "keyboard"
    Option "XkbLayout" "us"
    EndSection
    and the other being
    InputDevice "Keyboard0"
    in the ServerLayout section.
    Is there a newer way to do this? Perhaps omitting it altogether?
    I'm using xmonad, and I checked my keybindings in xmonad.hs to see if I had anything hilarious. Alas, I found nothing.

  • How can I (neatly) control mouse click events in a multi-dimensional array?

    Hello everyone!
         I have a question regarding the use of mouse clicks events in a multi-dimensional array (or a "2D" array as we refer to them in Java and C++).
    Background
         I have an array of objects each with a corresponding mouse click event. Each object is stored at a location ranging from [0][0] to [5][8] (hence a 9 x 6 grid) and has the specific column and row number associated with it as well (i.e. tile [2][4] has a row number of 2 and a column number of 4, even though it is on the third row, fifth column). Upon each mouse click, the tile that is selected is stored in a temporary array. The array is cleared if a tile is clicked that does not share a column or row value equal to, minus or plus 1 with the currently targeted tile (i.e. clicking tile [1][1] will clear the array if there aren't any tiles stored that have the row/column number
    [0][0], [0][1], [0][2],
    [1][0], [1][1], [1][2],
    [2][0], [2][1], [2][2]
    or any contiguous column/row with another tile stored in the array, meaning that the newly clicked tile only needs to be sharing a border with one of the tiles in the temp array but not necessarily with the last tile stored).
    Question
         What is a clean, tidy way of programming this in AS3? Here are a couple portions of my code (although the mouse click event isn't finished/working correctly):
      public function tileClick(e:MouseEvent):void
       var tile:Object = e.currentTarget;
       tileSelect.push(uint(tile.currentFrameLabel));
       selectArr.push(tile);
       if (tile.select.visible == false)
        tile.select.visible = true;
       else
        tile.select.visible = false;
       for (var i:uint = 0; i < selectArr.length; i++)
        if ((tile.rowN == selectArr[i].rowN - 1) ||
         (tile.rowN == selectArr[i].rowN) ||
         (tile.rowN == selectArr[i].rowN + 1))
         if ((tile.colN == selectArr[i].colN - 1) ||
         (tile.colN == selectArr[i].colN) ||
         (tile.colN == selectArr[i].colN + 1))
          trace("jackpot!" + i);
        else
         for (var ii:uint = 0; ii < 1; ii++)
          for (var iii:uint = 0; iii < selectArr.length; iii++)
           selectArr[iii].select.visible = false;
          selectArr = [];
          trace("Err!");

    Andrei1,
         So are you saying that if I, rather than assigning a uint to the column and row number for each tile, just assigned a string to each one in the form "#_#" then I could actually just assign the "adjacent" array directly to it instead of using a generic object to hold those values? In this case, my click event would simply check the indexes, one at a time, of all tiles currently stored in my "selectArr" array against the column/row string in the currently selected tile. Am I correct so far? If I am then let's say that "selectArr" is currently holding five tile coordinates (the user has clicked on five adjacent tiles thus far) and a sixth one is being evaluated now:
    Current "selectArr" values:
           1_0
           1_1, 2_1, 3_1
                  2_2
    New tile clicked:
           1_0
           1_1, 2_1, 3_1
                  2_2
                  2_3
    Coordinate search:
           1_-1
    0_0, 1_0, 2_0, 3_0
    0_1, 1_1, 2_1, 3_1, 4_1
           1_2, 2_2, 3_2
                  2_3
         Essentially what is happening here is that the new tile is checking all four coordinates/indexes belonging to each of the five tiles stored in the "selectArr" array as it tries to find a match for one of its own (which it does for the tile at coordinate 2_2). Thus the new tile at coordinate 2_3 would be marked as valid and added to the "selectArr" array as we wait for the next tile to be clicked and validated. Is this correct?

Maybe you are looking for

  • Ipad 3 acting crazy, doing things on it's own without touchng it.

    My friend's ipad 3 with retina display 32GB  is acting crazy. It switches between apps, closes/ opens apps, types, scrols, goes to home/ search and ...... by itself without even touching it. You can't think of using the ipad like this. It happens whe

  • MKS PR4000 CONTROLLER driver for labview 8.6

    Hello BZajec, Thanks for your reply. I have set up the instrument via null modem (crossed) RS232 cable and have communicated with the instrument via hyperterminal in Microsoft XP. The only command to which I have had a response is 'v' which has retur

  • Jdbc adapter stuck

    Hi All: We are facing problems with the JDBC adapter, for unknown reason the JDBC Adapter stuck and do not pick the table entries. The only way to fix the issue is                       - copy sender JDBC adapter                       - rename sender

  • IPhoto interacting with Facebook Albums...

    I just reorganized all of my facebook photos into new albums.  I wanted to upload some more photos directly from iPhoto but it is NOT recognizing any of my new albums.  How do I get it to bring in the names of these new albums so I can use them prope

  • HT4623 how to upgrade ipod 4.2.1 to 4.3

    my ipod is ios 4.2.1how can i upgrade to  ios4.3