How to capture Flash SWC events?

Can someone point me in the right direction on how to capture an event from a Flash SWC in Flex?
Scenario:
I have an animated gameboard that I built in Flash. Nothing fancy, just a simple tile game where you select a tile, click it and it flips over to reveal something.
I've managed to export a SWC, and get it to display just dandy in my Flex project, but I cannot figure out how to get Flex to capture and respond to any type of event... custom or predefined (such as MouseEvent.CLICK) when clicking one of the tiles in the swc.
I've done quite a bit of googling but I'm cross-eyed at this point and could use some expert direction.
Thanks in advance.
JL

Hi Alex,
After further research, I've found some answers to my questions, but I've encountered a related obsticle.
I finally stumbled upon the Flex 3 Component Kit documentation, and on page 9 of that document, it describes in detail an example of adding custom events.
To summarize, my related obsticle this:
I created a simple MovieClip symbol in Flash (named "My Circle").
I created a simple external class mimicing the example code in the Flex 3 Component Kit documentation (named "MyCircle.as") which extends mx.flash.UIMovieClip
The .fla containing the MovieClip symbol "My Circle" and the external class "MyCircle.as" reside in the same directory
In Flash I convert the symbol "My Circle" to a Flex component and verify that the class is "MyCircle" and there is no base class
I export the now converted MovieClip as a .swc file
In my Flex project, I add MyCircle.swc to the Library path
In my Flex project source I add an instance of MyCircle as <local:MyCircle id="my_circle" />
Switching to Design view in my Flex project I don't see anything. I refresh design view and still do not see a graphic representation of my .swc file. There are no errors or warnings
Using the Outline, I select the instance of MyCircle and discover that it is indeed on the stage, but it's bounding box dimensions are essentially zero. It seems there is no image in the swc.
Returning to Flash, I duplicated the MovieClip symbol, renamed it to "My Circle No External Class", and converted it to a Flex component. I also verified that this new component had a class name of "MyCircleNoExternalClass" and had a base class of mx.flash.UIMovieClip.
Following the above proceedure to correctly link it to my Flex project's Library path and adding an instance of <local:MyCircleNoExternalClass /> to the source, the .swc file show's up beautifully.
So, why would adding an external class file (with the ultimate goal of being able to dispatch custom events) cause the contents of the MovieClip itself to not be included in the .swc?
Again, I'm following the example on page 9 of the Flex 3 Component Kit documentation and using the Flex 3.3 SDK.

Similar Messages

  • How to capture Wnidows(OS) event from Java program

    Hi,
    I am developing one application , in that if the user didn't do any thing in 15 mins,i need to log out from my application(not windows).Here i need to check Java event as weel as windows(OS) events also.Any one knows how to capture the OS events??

    I want to know the status of mouse and keyboard(Windows 2000).If the status of the mosue or keyboard doesn't change from 15min i need to log of the java application.

  • Does anyone know how to capture a menu event on a existing EXE program?

    I have figured out how to add menu Item to an existing EXE program, but I have not yet been able to figure out how to capture there events.  Any help would be greatly appreciated.

    "[email protected]" <[email protected]> wrote in message news:[email protected]..
    I have figured out how to add menu Item to an existing EXE program, but I have not yet been able to figure out how to capture there events.&nbsp; Any help would be greatly appreciated.
    It's not entirely clear what you are trying to acieve. I think you're trying to add menu items to an exsisting exe without recompiling it, from LabVIEW. If so the following applies.
    You have to hook the winproc. When a menu item is selected, windows send a message to the window's winproc. There are some API's that can be used to point the address of the winproc to another routine. This routine can do filtering, and then call the original routine.
    Note that LabVIEW doesn't (or didn't until LV7) use windows menu's, so when a LabVIEW (or exe created with LabVIEW) menu item is called, windows will not send anything. That is the price for platform independency.
    I think the OpenG site (or perhaps Winutils from NI) has some vi's to hook windows messages that are send to LabVIEW. Perhaps you can also use them hook another application.
    Regards,
    Wiebe.

  • How to capture remote control events

    Hello, I am now writing some simple xlets to test UI .
    I can successfully receive arrow key and enter using KeyEvent,but failed at color key and other
    keys in remote control. I have read some articles and got quite confused about the event model
    of MHP,it seems complex to beginners.
    I tried to receive color key event by this way:
    a: main class (HComponent) implements xlet and UserEventListener;
    b: define one userEventRepostiroy colorKey and add all colored key to it.
    c: EventManager.getInstance().addUserEventListener(this,colorKey);
    d:implement the userEventReceived method
    I tried the color keys in remote control of my emulator ,but not captured, Can you tell me why? Thanks!!!!

    Hi,
    I am trying to program a normal JFrame application which can capture remote control inputs. (I know very little about Xlets. I just need a listener for an application).
    Many of the buttons are captured by a normal KeyListener but some aren't (player controls like play/pause and red/green/yellow/blue colour buttons). Also, most of the ones that are captured just have keyCode() = 0 and keyChar() = '' so I can't determine which button was actually pressed.
    Is there any way I can implement the UserEventListener example above without using an Xlet? Alternatively, is there any way I can manipulate KeyListener to get ALL button presses from the remote control? Any other ideas?
    Thanks,
    Brian
    PS - here is my attempt: (Am I missing the point altogether? Not sure if a UserEventListener can be added to a component like other listeners)
    package remotecontrol;
    import javax.swing.JFrame;
    import org.dvb.event.*;
    public class frame extends JFrame implements UserEventListener
        public frame()
            UserEventRepository rep = new UserEventRepository("whatever");
            rep.addAllArrowKeys();
            rep.addAllNumericKeys();
            rep.addAllColourKeys();
            EventManager.getInstance().addUserEventListener(this, rep);
            setSize(200,100);
            setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
            show();
        public static void main(String[] args)
            frame app = new frame();
        public void userEventReceived(UserEvent userEvent)
            System.out.println("Remote button press captured: " + userEvent.getCode());
    }

  • How to capture Mouse Down event outside a control?

    Mouse Capture doesn't work:
    public partial class MainWindow : Window
    public MainWindow()
    InitializeComponent();
    Button button1 = new Button();
    button1.Width = 50;
    button1.Height = 20;
    this.Content = button1;
    Mouse.Capture(button1);
    button1.PreviewMouseDown += Down;
    private void Down(object sender, MouseButtonEventArgs e)
    MessageBox.Show("Hello World!"); // doesn't show

    Hi Ziya,
    the Capture-method returns a bool whether the capture was successful or not. So when you do this, you'll see that your capture didn't work:
    public MainWindow()
    InitializeComponent();
    Button button1 = new Button();
    button1.Width = 50;
    button1.Height = 20;
    this.Content = button1;
    var success = Mouse.Capture(button1);
    if(!success)
    MessageBox.Show("Not captured");
    button1.PreviewMouseDown += Down;
    The problem with the code above is that your Window is not loaded at that time when the code in the constructor is executed. And as long as it is not loaded, there's nothing to capture. :-)
    So you should do your capture-logic in the Loaded-event of the window. That event occurs after the Window has been loaded. So the code below will work for you:
    public MainWindow()
    InitializeComponent();
    Button button1 = new Button();
    button1.Width = 50;
    button1.Height = 20;
    this.Content = button1;
    this.Loaded += (s, e) =>
    var success = Mouse.Capture(button1);
    if (!success)
    MessageBox.Show("Not captured");
    button1.PreviewMouseDown += Down;
    Thomas Claudius Huber
    "If you can't make your app run faster, make it at least look & feel extremly fast"
    My latest Pluralsight-courses:
    XAML Layout in Depth
    Windows Store Apps - Data Binding in Depth
    twitter: @thomasclaudiush
    homepage: www.thomasclaudiushuber.com

  • Urgent Help need - How to capture client change event

    Dear Gurus,
    I am not able to track whether user has changed any field in the table or not. I am using IWDNodeElement.isChangedByClient  to capture , but it is always returning me false.
    PLEASE HELP.
    Sample code
    wdContext.nodeTravelTable().moveFirst();
              try
                   for(int i = 1; i <= tblSize; i++)
                        wdComponentAPI.getMessageManager().reportSuccess("Currency is " + wdContext.currentCurrency_travelTableElement().getCElement());
                        wdComponentAPI.getMessageManager().reportSuccess("Is client changed" + wdContext.currentTravelModeElement().isChangedByClient());
                        if(wdContext.currentTravelModeElement().isChangedByClient())
    Thanks in Advance.
    Best Regards,
    Prasad PMV
    PS:Max points will be awarded for any kind of help

    Reply by Thomas Chadzelek 
    I would not recommend to use the changed()/isChanged() methods. They represents "dirty flags" used by our framework in certain situations ("delta handling"). I don't think that applications need access to it, except in certain situations. Anyway, these flags are set whenever an attribute is changed and reset at the end of the roundtrip.
    isChangedByClient() represents a different set of "dirty flags" whose reset is under the application's control. They are set whenever a user changes an attribute (through the Web Dynpro client), but not when server-side code does such a change.
    In NW04, these flags are quite coars-grained. A node element is marked as changed when any of its attributes has been changed.

  • Click event on Autosuggest Listbox. How to capture it ?

    Hello.
    I'm trying without much success to understand how to capture
    the click event on the listbox associated with the Spry Autosuggest
    Widget.
    At this address:
    http://labs.adobe.com/technologies/spry/samples/autosuggest/SuggestSample.html
    it is described how to use the widget. For an istance when
    you type 'Ado' in the first textbox of the page, the listbox (or
    what looks like a listbox) appears with all the possible Adobe
    products beginning with 'Ado'. As the user clicks on a product,
    let's say 'Adobe Acrobat Professional', its description is passed
    to the textbox.
    Fact is, I would like to capture the event of the clicking on
    the Listbox item. Is there a way to obtain that ?
    I would really like to be able to call a JS function when an
    item is selected there...
    I would appreciate any help to solve the problem.
    Regards,
    Newcomsas

    Hi, adding an onClick event handler ist quite easy. my code
    looks like this:
    <div id="VKundenAS" spry:region="dsKunden">
    <div onclick="updateVKundenUUID('{f_uuid}');"
    spry:repeat="dsKunden"
    spry:suggest="{f_name}">{f_name}</div>
    </div>
    Just add the event handler to the corresponding list element
    (here it is a DIV-tag).
    Unfortunately this only works with mouse interaction
    (onClick), if you navigate with the keyboard, no custom JS is
    called. So you have to disable keyboard selection on the
    autosuggest widget, in order to make sure the JS gets called.
    Best wishes,
    Nils

  • How to capture show layer and hide layer event in photoshop through a plugin???

    How to capture show layer and hide layer event in photoshop through a plugin???for mac

    Use the Listener plug-in found in the SDK to see how you can monitor the show/hide layer event. You can also use the Getter plug-in to show what information you can find out about the current state of Photoshop.

  • How to Capture Button event on TrainBean navigation

    Hi All
    i m being required to capture a button event in train bean Navigation, i m doing customization in Iexpense Module,here in Create IExpenseReport i need to capture the events of Remove,Return etc.how is it possible any clue would be very helpful.
    Thanx
    Pratap

    try this..
    if (GOTO_PARAM.equals(pageContext.getParameter(EVENT_PARAM))
    "NavBar".equals(pageContext.getParameter(SOURCE_PARAM))
    // This condition checks whether the event is raised from Navigation bar
    // and Next or Back button in navigation bar is invoked.
    int target = Integer.parseInt(pageContext.getParameter(VALUE_PARAM));
    // We use the parameter "value" to tell use the number of
    // the page the user wants to visit.
    String targetPage;
    switch(target)
    case 1: targetPage = "/oracle/apps/dem/employee/webui/EmpDescPG"; break;
    case 2: targetPage = "/oracle/apps/dem/employee/webui/EmpAssignPG"; break;
    case 3: targetPage = "/oracle/apps/dem/employee/webui/EmpReviewPG"; break;
    default: throw new OAException("ICX", "FWK_TBX_T_EMP_FLOW_ERROR");
    HashMap pageParams = new HashMap(2);
    pageParams.put("empStep", new Integer(target));
    pageContext.setForwardURL("OA.jsp?page=" + targetPage,
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    pageParams,
    true, // Retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO, // Do not display breadcrumbs
    OAWebBeanConstants.IGNORE_MESSAGES);
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to capture the current info in the top-of-page event in Reuse block dis

    How to capture the current info in the top-of-page event in Reuse block dis

    Hi Geetha,
         If you don't have any information to pass the Heading Block, then why you are using this event ?
         please comment/ remove that TOP_OF_PAGE code. and use subtotal code in field catalog block.
          you can use below code for subtotal. 
          FORM field_catalog .
                    gs_fcat-do_sum = &2.
              fcat : 'WRBTR' '15' 'X' ' ' ' ' 'WRBTR' 'Amount',
           ENDFORM.
           Regards,
           Kunjan

  • How to capture the event in ALV grid display?

    Hi experts,
      How to capture the event in an ALV grid display which is editable. I have to capture the TAB key or ENTER key.
    regards,
    Arul Jothi.

    Hi Arul,
    Take a look at sample program BCALV_EDIT_03. (Find string "register ENTER" in the program to see how to register)
    Basically you have to Register edit events using method call REGISTER_EDIT_EVENT and then write a handler method for event DATA_CHANGED..
    If you are using a REUSE..GRID fm then first get the grid reference using function module GET_GLOBALS_FROM_SLVC_FULLSCR and then repeat the above procedure..
    Hope this helps..
    Sri
    Message was edited by: Srikanth Pinnamaneni

  • JComboBox: how to capture the internal list  events?

    Hi
    Does anybody know how to capture JComboBox internal list events, what I mean
    is when I click the box arrow button a list of the items pops up and as you move the mouse inside that list up and down, an items gets highlighted.
    So I am interested in capturing those events - basically when the next item from the list is highlighted.
    Thanks

    You can add an item listener to the combo box for that. IIRC, your listener will get
    notified twice: once for the deselection of the previous item, and once for the new
    item's selection.
    : jay

  • How to capture the media player events on Safari (Windows)?

    [Source]
    <script type="text/javascript" for="wmp" event="PlayStateChange(e)">
    alert(e);
    </script>
    <embed src="mms://~~" type="video/x-ms-wmv" id="wmp" name="wmp">
    How can i get the media player events?
    I think "PlayStateChange" dosen't work.
    Please help me..

    i want to listen the events fired on the title bar....It seems you are trying to capture some other events(???) other than Window_Minimized ,Window_Closed and Window_activated.
    Could you pls explain what are those events you wish to trap ?

  • How to capture previously clicked button(previous event)?

    Hi guyz,
    I have frame in which i have different panels. I would like to capture the last clicked button. My objective is to bring a pop-up box(dialog) when anything other than a specific button is clicked in one of the panels. So, i would like to know if i can see what button was clicked previously. Does anyone know?

    How to capture previously clicked button(previous event)?Store it somewhere and then you can use it later:
    ActionListener previousActionEvent;
    JButton b = new JButton();
    b.addActionListener(new ActionListener(){
       public void actionPerformed(ActionEvent evt){
          previousActionEvent = evt;
    });

  • How can I capture mouse click events on BSP or Web Dynpro ABAP Screen

    hi Guys,
    Currently we have a user inactivity problem,
    the requirement is: if user is clicking on BSP/Web Dynpro ABAP screen, he/she is considered active. so we need an mechanism to capture the mouse click event.
    Using Firebug, we found that this js is in the iframe which contains BSP/web dynpro scrren: /sap/public/bc/ur/nw5/js/languages/urMessageBundle_en.js
    we want to find this js file & put in some javascript code to track user's mouse click, but i cannot find it on server.
    while in ie if we type http://host:port/sap/public/bc/ur/nw5/js/languages/urMessageBundle_en.js
    this file can be downloaded, means this file is there.
    Any one can help on this issue? find the js file or another way to capture the mouse click event.
    Thanks a lot with points!

    Hi  Feng Guo,
                        We can not capture mouse click events on Web Dynpro ABAP Screen . I am not sure about BSP. But as for as I know the portal keep active the iViews until unless mouse clicks happens.
    But for your problem I think you can get solution by setting iView Expiration to some more time period.
    Regards,
    Siva

Maybe you are looking for