Dispatching events...

Hi,
I am working on a project for a system that will not have a mouse. Ideally I would like the screen to function almost like a video game would -- even though it is not a game. By this I mean that all keystrokes are handled at the window level and dispatched to the correct component depending on the keystroke.
Currently I have inhibited the ability of components on the form to gain focus. When I press a key, the listener associated with the JFrame responds... I then attmpt to use dispatchEvent inside of a case statement to route events to the proper components (In this case a JTextField) The problem is, is that allthough the dispatchEvent call is made, the JTextField doesn't do anything with it. I am just typing characters so I would expect all these keystrokes to show up in the JTextField, but it does not work.
Does anybody know why this might not work?
-Benjamin

Here is a code snippet that actually seems to work. The problem was that I was dispatching a keyPressed event rather than a keyTyped.
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
class NoFocus extends JFrame implements KeyListener {
   private class JTextFieldNF extends JTextField {
      public JTextFieldNF(int size) {
         super(size);
      public boolean isFocusTraversable() {
         return false;
   JTextFieldNF tfnf;
     public NoFocus() {
      tfnf = new JTextFieldNF(20);
      getContentPane().setLayout(new FlowLayout());
      getContentPane().add(tfnf);
      addKeyListener(this);
     public void keyPressed(KeyEvent evt) {
   public void keyTyped(java.awt.event.KeyEvent evt) {
      switch (evt.getKeyCode()) {
         // Route up and down key somewhere else
         case KeyEvent.VK_UP:
         case KeyEvent.VK_DOWN:
            break;
         // All keystrokes not expicitly used are piped to tfnf
         default:
                  tfnf.dispatchEvent(evt);
   public void keyReleased(java.awt.event.KeyEvent A) {
     public static void main(String args[])
          JFrame frame = new NoFocus();
          frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
          frame.setSize(200,200);
          frame.setVisible(true);

Similar Messages

  • [Embed(source="...   And dispatching events and trace commands not working

    Hi,
    I have a main swf that Embeds another swf.  In the embedded (child) swf I have trace commands and it dispatches events. 
    I embed the child swf like this:
    [Embed(source="../assets/child.swf", symbol="ChildMC")]
    public var ChildMC:Class;
    var child_mc = new ChildMC();
    child_mc.addEventListener(Event.COMPLETE, childComplete);
    addChild(child_mc);
    function childComplete(event:Event):void
    at the end of the timeline in the child swf I have: dispatchEvent(new Event(Event.COMPLETE));
    When I test the main swf, I can see the child swf, but the main swf can't catch any of the dispatched events and I don't get any trace commands from the child swf.
    How can I catch events from an embedded swf?
    thanks!

    I did a quick sample with two fla's.
    The first loads in a child swf and then calls a funtion on the main timeline:
    var url:String = "loadTestChild.swf";
    var urlRequest:URLRequest = new URLRequest(url);
    var loader:Loader = new Loader();
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loader_complete);
    loader.load(urlRequest);
    addChild(loader);
    function loader_complete(evt:Event):void {
       evt.currentTarget.content.callMeFromParent();
    The child swf has this code on the main timeline:
    function callMeFromParent ():void {
              trace ("called from parent whoop");
    Running the parent, the trace is called.
    So with this you should be able to call any function you have in the child from the parent.

  • On-dispatch-event trigger related to mscomm (load weight from weight scale

    aoa!
    please guide me to pick weight from weight scale.
    i m using mscomm32 ocx for this purpose.
    clarify the role of on-dispatch-event trigger and specify all events
    regarding mscomm and also explain how to trap events for accomplish
    task.
    thanks in advance.
    Tool used:developer 6i & oracle 10g windows xp(sp2)professional.

    Thanks, but I've already seen this thread and done the steps described on it.
    Actually, my question is very specific... How to populate the fields LinkVal and LinkUnit of the registry...
    I read all the threads here in SDN and they don't answer my question...
    I'd be glad if someone had already done tcode HUPAST works for Filizola...
    Tks again.

  • Questions on Dispatching events

    Hey all,
    I have been trying to get a grasp on dispatching events and have a few questions I am hoping you will all be nice enough to clearify for me.
    Do I have to have a custom Event class to dispatch a custom event?
    If so do I have to create a new intance of the event each time I want to dispatch an event. Example:
    dispatchEvent(new MyEvent(MyEvent.TASK_COMPLETE));
    or can I just dispatch an event once an instance has already previously been created.... example:  dispatchEvent(MyEvent.TASK_COMPLET);?
    Thanks,

    hi
    if you dont need to pass any data along with the event then you dont need a custom event, you can just use a custom event name. eg: dispatchEvent(new Event("myEventName"));
    if you want to dispatch the same event multiple times, you can (but not sure why you would want to do that?), eg:
    var e:Event = new Event("myEventName");  [or new MyCustomEvent("myCustomEventName", myCustomData) ]
    dispatchEvent(e);
    dispatchEvent(e);
    dispatchEvent(e);
    dispatchEvent(e);
    dispatchEvent(e);
    dispatchEvent(e);

  • Dispatching events from JNI

    I've got an application that is trying to watch for mouse events anywhere and everywhere. The goal is to be in-the-know when there is mouse activity going on in general, with the Java app running in the taskbar.
    I have determined that I'll likely need JNI to accomplish this, as paying attention to mouse activity over the whole operating system is somewhat operating system dependent. : )
    Nevertheless, I'd like Java code to handle the events, and I can't seem to find any way for JNI to dispatch events back to the Java side of things. My hope was to catch the events thrown by the system in C/C++ and then simply dispatch them again to act as a middle-man.
    If anybody can tell me how I might accomplish this using JNI, or even a step in the right direction, I would greatly appreciate it. Or, if I'm barking up the wrong tree, please please let me know.
    Thanks,
    - J

    Steps in order
    1. Determine how to capture the events in C/C++. There is no java in this step.
    2. Write an API in C/C++ that models the functionality that you want to use in java. There is no java in this step.
    3. Write java/jni that uses the API in 2. There is java in this step.
    As a callback you will need to use the jni attach thread method.
    You better be careful as messing up on any of the steps above can render your mouse inoperable for the entire OS, so learn the keyboard shortcuts.
    I think that someone posted code like this in the past. I could be mistaken however.

  • Dispatching event from Javascript

    Can I dispatch events from javascript to flash player? I am trying to do so by calling dispatchEvent() on flash player dom object but the event is not passing inside flash player. Any links or clue?

    To be specific ... I can catch a right click and supress it. But I want to send it to flash (lets say) as a left click. Problem is when i do that, javascript listner for dom element will get fired for left click but there wont be any events in flash.
    SO the question is can i fire events on flash from outseide or is it outside the public APIs?

  • Dispatching events between different classes

    Im trying to dispatch and event from an XML class.
    dispatchEvent(new Event (XMLClass.INDEX_CHANGED));
    and catch it in the display class
    import AS.XMLClass;
    private var _xml  = new XMLClass();
    _xml.addEventListener(XMLClass.XML_LOADED, swapImage);
    I know that im missing something because the application works
    and the function runs but its not dispatching the event the event
    or maybe it's not catching the event in the display class, even though everything else is working
    and im not gettin' any errors.

    that's exactly what i did.
    i have 3 classes
    AS.XMLClass
    AS.ControlClass
    AS.DisplayClass
    It's like a slideshow thing.
    I have a button on stage thats connected to the control class and every time you press it
    it changes the index of the image in the xmlclass and everytime that the index is changed the xmlclass needs to
    dispatch and event that the index has changed and the display class is going to catch the event and change the image
    everything is working except the xmlclass dispatch event or the displayclass catch event
    XMLCLASS
    public static const INDEX_CHANGED:String = "indexChanged";
    private function dataLoaded(event:Event):void{
                trace("xml file is loaded");
                data = new XML(loader.data);
                dispatchEvent(new Event(XMLClass.XML_LOADED));
                totalItems = data.images.photo.length();
                setCurrentIndex(currentIndex);
    CONTROL CLASS
    import AS.XMLClass;
    private var _xml = new XMLClass();
    public function leftButtonClicked(){
                _xml.setCurrentIndex(_xml.currentIndex = _xml.currentIndex - 1);
            public function rightButtonClicked(){
                _xml.setCurrentIndex(_xml.currentIndex = _xml.currentIndex + 1);
    DISPLAY CLASS
    import AS.XMLClass;
    private var _xml  = new XMLClass();
    _xml.addEventListener(XMLClass.XML_LOADED, swapImage);
    public function swapImage(event:Event){
                trace("working....");

  • Dispatching Events - External SWF & Main Stage

    Hi Everyone
    I am dispatching two different events showbutton and removebutton from the code inside the LOADED SWF.
    on main file, (the one that is loading the swf file) i m listening for events and either showing or removing the
    buttons based on proper scenario. Here is he error i m getting. I appreciate if someone can help me understand
    the problem thanks.
    ERROR   1180  Call to a possibly undefined Method Event   - - - > dispatchEvent(new Event("showbutton"));
    -----------------EXTERNAL SWF -----------------
    dispatchEvent(new Event("removebutton"));
    dispatchEvent(new Event("showbutton"));
    -----------------MAIN STAGE-----------------------
    movieLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaderCompleteHandler)
    function loaderCompleteHandler(event:Event) {
        (event.currentTarget.content as MovieClip).addEventListener("removebutton", categoryClickHandler);
        (event.currentTarget.content as MovieClip).addEventListener("showbutton", categoryClickHandler2);
    function categoryClickHandler(event:Event):void {
        alaarm.visible=false
    function categoryClickHandler2(event:Event):void {
        alaarm.visible=true
        trace("yohoo");

    MathAdor,
    Have you considered solutions that don't involve event handlers available to AS3.
    If I understand correctly you are trying to:
    1.  Control buttons that exist in your main .swf file
    2.  Control the visibility of those buttons from a child .swf called into existence from the main .swf file
    You could control this completely from the child .swf by setting a variable for your parent .swf
    In your child .swf creat a variable that contains the parent movieclip:
    var myParentClip:MovieClip = MovieClip(parent.parent);
    Now control your buttons with the appropriate command from your child
    myParentClip.buttonName.visible = true;
    myParentClip.buttonName.visible = false;
    Total control from your child .swf
    Hope this helps

  • Dispatching Event in ItemRenderer Component?

    Am I going about this the right way? Here's my situation:
    I have a custom itemRenderer for a List. This itemRenderer consists mainly of a checkbox and label, but has a few additional details in it (which is why I'm not using a drop-in itemRenderer). I want to detect when the selection of the checkbox changes, so I was thinking of creating a custom event in the itemRenderer and then bubbling it up to the list.
    Or is there a way I can detect when a user checks a checkbox from the lists itself?
    Thanks!

    I found this article which explains this topic very well also: http://weblogs.macromedia.com/pent/archives/2008/03/itemrenderers_p_2.html
    (It appears that these may be referencing the same series of articles on different sites.)
    However, I am now conflicted, because if I the version without bubbling, I am tying the itemRenderer directly to my component; whereas with bubbling I don't need to make that association. I may opt for the bubbling route after all, because I want to keep my itemRenderers generic enough to use in any of my custom controls, and not just in a certain type.
    For more clarification: the hangup is where the event gets triggered on the listData.owner. To do this, it appears that it must be type-cast first, and then manipulated. Any ideas on how to get around that? Here's Peter's example:
    ====================================
    First, you have to add metadata to the CatalogList control to let the compiler know the control dispatches the event:
         import events.BuyBookEvent;
         import mx.controls.TileList;
         [Event(name="buyBook",type="events.BuyBookEvent")]
         public class CatalogList extends TileList
    Second, add a function to CatalogList to dispatch the event. This function will be called by the itemRenderer instances:
              public function dispatchBuyEvent( item:Object ) : void
                   var event:BuyBookEvent = new BuyBookEvent();
                   event.bookData = item;
                   dispatchEvent( event );
    Third, change the Buy button code in the itemRenderer to invoke the function:
                   <mx:Button label="Buy" fillColors="[0x99ff99,0x99ff99]">
                        <mx:click>
                        <![CDATA[
                             (listData.owner as CatalogList).dispatchBuyEvent(data);
                        ]]>
                        </mx:click>
                   </mx:Button>
    Now the Button in the itemRenderer can simply invoke a function in the list control with the data for the record (or anything else that is appropriate for the action) and pass the responsibility of interfacing with the rest fo the application onto the list control.
    ====================================

  • Dispatch Event for loaded Netconnection datas

    Hi All!
    I made a manager component to retrieve data from database
    through amfphp.
    When the datas are loaded at the end of the "onResult"
    function, I dispatch an event "contactLoader"
    Another parent mxml component has an instance of my manager
    component with a call to a function contactLoader="getData()",
    and then this function calls in turn the getContacts()
    function of the instantiated manager component to retrieve the
    datas. Thus I am sure that the datas are correctly loaded by my
    manager before to retrieve the Array.
    But I would like to refresh this array in case any change has
    been made in the database. The problem is that the listener is
    created automaticly by the instance of my manager component and the
    "contactLoader" already exists once the data are loaded once. I
    need a way to reload the data in the manager , create a new event
    once the data are downloaded and then my parent component can call
    one more time the getContacts function.
    Is it the right way to do that? I'm not skilled enouth to
    solve that problem. Thanks for your help.

    "badoumba" <[email protected]> wrote in
    message
    news:gk57nf$oak$[email protected]..
    > Hi All!
    > I made a manager component to retrieve data from
    database through amfphp.
    > When the datas are loaded at the end of the "onResult"
    function, I
    > dispatch an
    > event "contactLoader"
    > Another parent mxml component has an instance of my
    manager component with
    > a
    > call to a function contactLoader="getData()",
    > and then this function calls in turn the getContacts()
    function of the
    > instantiated manager component to retrieve the datas.
    Thus I am sure that
    > the
    > datas are correctly loaded by my manager before to
    retrieve the Array.
    >
    > But I would like to refresh this array in case any
    change has been made in
    > the
    > database. The problem is that the listener is created
    automaticly by the
    > instance of my manager component and the "contactLoader"
    already exists
    > once
    > the data are loaded once. I need a way to reload the
    data in the manager ,
    > create a new event once the data are downloaded and then
    my parent
    > component
    > can call one more time the getContacts function.
    I'm not sure what the issue is...you can fire a new
    contactLoader event
    whenever you need to.

  • Class is not dispatching Event without timer of 1 second. Why?

    Hi All,
    I have created a class Called ClassA and ClassA creates a instance of ClassB and adds the listener to ClassB. Then after some processing ClassB dispatches the event.
    Issue:- ClassB is only able to dispatch the event if I call the dispatchEvent(new Event(Event.COMPLETE)) function in ClassB by giving the 1 second interval otherwise it is not sending any event.
    Question-Could someone explain this behaviour?

    Then you should probably post the question in the ActionScript 3 forum.
    This forum is for OpenType Font Development Kit questions.

  • Dispatching Events on overlapping Components

    Hello,
    i use a layered pane that contains some custom components. How can I make that two overlapping components that reside in the same layer both receive a mouseEvent?
    At the moment, only the Componet above receives the event - I know I can pass an Event with dispatchEvent - but i don't know the instance of the component to which to pass it of course... Is there any method to dispatch the event without having to know to which component to pass it?
    Any help appreciated.
    Best regards & Thanks.
    alex

    You can use use EventQueue.postEvent to post the event, but it requires source and if it is mouse event it will be later retargeted to correct components according to coordinates. So the only way for you to do this is to find the components by yourself and call processMouseEvent on it.

  • IGE.graphic dispatches Event.REMOVED_FROM_STAGE events after each updatecomplete event

    When I type in TLFtextField dispatches RemovedFromStage events after each word! Why?
    var em:EditManager= new EditManager()
    em=txt.textFlow.interactionManager as EditManager
    var MC:mc=new mc()
    MC.addEventListener(Event.REMOVED_FROM_STAGE,rs)
    txt.textFlow.addEventListener(StatusChangeEvent.INLINE_GRAPHIC_STATUS_CHANGE,u)
    em.insertInlineGraphic(MC,"auto","auto")
    function u(e:StatusChangeEvent):void{
          if(e.status==InlineGraphicElementStatus.READY ||e.status==InlineGraphicElementStatus.SIZE_PENDING){
               txt.textFlow.flowComposer.updateAllControllers()
               if(e.status=="ready")txt.textFlow.removeEventListener(StatusChangeEvent.INLINE_GRAPHIC_ST ATUS_CHANGE,u)
    function rs(e:Event):void{
    trace(e.type)

    Thank you Richard
    This happens only if I set the IGE.float to none. Is there any other way
    to know if an IGE is removed from stage(user deletes it for e.g.)?
    Now my code is something like this:
    var em:EditManager= new EditManager()
    txt.textFlow.interactionManager=em
    em.textFlow.addEventListener(StatusChangeEvent.INLINE_GRAPHIC_STATUS_CHANGE,statusChanged)
    file.addEventListener(Event.SELECT,graphicSelected)
    function graphicSelected(e:Event){
      var flv:FLVPlayback= new FLVPlayback();
      flv.skin = "/SkinOverAllNoCaption.swf";
      flv.autoPlay = false;
      flv.source = new URLRequest(file.nativePath).url;//"C:/Users/Dell/Desktop/flv.f4v" for example
      flv.addEventListener(Event.REMOVED_FROM_STAGE,removeHandler);
      em.insertInlineGraphic(flv,"auto","auto""none", new SelectionState(txt.textFlow,0,0))     
      em.textFlow.flowComposer.updateAllControllers()
    function statusChanged(e:StatusChangeEvent):void
    trace(e.status)
    if(e.status==InlineGraphicElementStatus.READY ||e.status==InlineGraphicElementStatus.SIZE_PENDING){
      em.textFlow.flowComposer.updateAllControllers()
      if(e.status==InlineGraphicElementStatus.READY){
          txt.textFlow.removeEventListener(StatusChangeEvent.INLINE_GRAPHIC_STATUS_CHANGE,statusCha nged)
      gr.id=file.name//"flv.f4v" for example
    function removeHandler(e:Event):void
    if (e.currentTarget as FLVPlayback)
      var flv:FLVPlayback = e.currentTarget as FLVPlayback;
      ID=flv.source.substr(flv.source.lastIndexOf("/")+1)
      if (! em.textFlow.getElementByID(ID))
      var vp:VideoPlayer = flv.getVideoPlayer(0);
      vp.close();
      trace("REMOVED : "+ID); 
      currentGraphic=null
    else if(e.currentTarget as Loader){
      currentGraphic=null
    But the problem is the removeHandler function will check for existance of ALL IGEs with float set to
    none after typing each word, right?
    BTW Sorry for my bad English!

  • Dispatch event from itemrenderer

    Greetings.
    i've got a main applicationxml: main.mxml
    followed by a component: optionbox.mxml, being loaded in the
    main.mxml.
    in optionbox.mxml another component is loaded:
    optionCanvas.mxml
    inhere, a datagrid is being created with a custom
    itemrenderer: itemsRenderer.mxml
    in this itemsRenderer (wich alters the display of the cells)
    is an image located.
    when you click this image, an object has to be dispatched to
    the main.mxml.
    how can I do this? It works when I dispatch from a component,
    but not from an itemrenderer.
    can anyone help me out.??
    main.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="vertical"
    xmlns:c="comp.*"
    backgroundAlpha="0"
    backgroundColor="#FFFFFF">
    <mx:«»Style>
    global{
    fontFamily:Arial;
    Canvas{
    color:#000000;
    .FooterLink{
    color:#0066CB;
    fontWeight:Bold;
    fontThickness:900;
    .Footer{
    backgroundColor:#E1F0F7;
    DataGrid{
    borderThickness:0;
    selectionColor:#FFFFFF;
    selectionDisabledColor:#FFFFFF;
    disabledColor:#FFFFFF;
    rollOverColor:#FFFFFF;
    ToolTip {
    fontFamily: Arial;
    fontSize: 12;
    color: #000000;
    </mx:«»Style>
    <mx:«»Script>
    <![CDATA[
    import events.itemEvent;
    import mx.rpc.events.ResultEvent;
    import mx.collections.ArrayCollection;
    [Bindable]
    private var selectedItems:ArrayCollection = new
    ArrayCollection();
    private function photoSelectedHandler(event:itemEvent):void{
    selectedItems.addItem(event.selectedItem);
    ]]>
    </mx:«»Script>
    <mx:VBox width="980" height="100%">
    <mx:HBox>
    <mx:VBox>
    <c:LeftPane id="leftpane" width="201" height="100%" />
    <c:Checkout id="checkout" selectedItems="{selectedItems}"
    styleName="checkout" fontWeight="bold"/>
    </mx:VBox>
    <c:«»Swfcontainer width="537"
    height="405" />
    <c:OptionBox width="222" height="100%" id="optionBox"
    itemSelected="{photoSelectedHandler(event)}"/>
    </mx:HBox>
    <c:Footer width="100%"
    styleName="Footer"></c:Footer>
    </mx:VBox>
    </mx:Application>
    [/code:1]
    optionbox.mxml
    [code:1]<?xml version="1.0" encoding="utf-8"?>
    <mx:HBox xmlns:mx="
    http://www.adobe.com/2006/mxml"
    color="#400000" creationComplete="printerData.send()"
    xmlns:c="comp.*">
    <mx:Metadata>
    [Event(name="itemSelected",
    type="events.itemEvent"«»)]
    </mx:Metadata>
    <mx:«»Script>
    <![CDATA[
    import mx.rpc.events.ResultEvent;
    import mx.collections.ArrayCollection;
    [Bindable]
    public var printer:ArrayCollection
    private function printerDataHandler(event:ResultEvent):void{
    printer = new ArrayCollection();
    printer=event.result.printer.confItem;
    ]]>
    </mx:«»Script>
    <mx:HTTPService id="printerData" url="data/data.xml"
    result="printerDataHandler(event)"/>
    <mx:Accordion id="accOptions" width="100%" height="100%"
    headerHeight="32" backgroundAlpha="0" fontSize="11" color="#0066CB"
    resizeToContent="true">
    <mx:Canvas label="{printer.getItemAt(0).label}"
    width="100%" height="100%" backgroundAlpha="0">
    <mx:VBox>
    <mx:Text width="198"
    htmlText="{printer.getItemAt(0).text}" />
    </mx:VBox>
    </mx:Canvas>
    <mx:Repeater id="repAccOptions" dataProvider="{printer}"
    startingIndex="1" >
    <c:optionCanvas
    itemData="{repAccOptions.currentItem}"/>
    </mx:Repeater>
    </mx:Accordion>
    </mx:HBox>[/code:1]
    optionCanvas.mxml
    [code:1]<?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="
    http://www.adobe.com/2006/mxml"
    label="{itemData.label}" width="100%" height="100%"
    verticalScrollPolicy="off">
    <mx:«»Script>
    <![CDATA[
    [Bindable]
    public var itemData:Object;
    ]]>
    </mx:«»Script>
    <mx:VBox width="100%">
    <mx:Text width="100%" htmlText="{itemData.text}" />
    <mx:«»DataGrid
    dataProvider="{itemData.consumables.consumable}"
    headerHeight="0"
    width="100%" itemRenderer="itemRenderers.OptionsRender"
    alternatingItemColors="#FFFFFF">
    <mx:columns>
    <mx:«»DataGridColumn
    dataField="consumableLabel" width="200"/>
    </mx:columns>
    </mx:«»DataGrid>
    </mx:VBox>
    </mx:Canvas>[/code:1]
    optionsRenderer.mxml
    [code:1]<?xml version="1.0" encoding="utf-8"?>
    <mx:HBox xmlns:mx="
    http://www.adobe.com/2006/mxml"
    verticalScrollPolicy="off" horizontalScrollPolicy="off" width="165"
    height="45">
    <mx:Metadata>
    [Event(name="itemSelected",
    type="events.itemEvent"«»)]
    </mx:Metadata>
    <mx:«»Script>
    <![CDATA[
    import events.itemEvent;
    [Bindable]
    public var selectedItem:Object;
    private function addItem(itemObj:Object):void{
    selectedItem = new Object();
    selectedItem = itemObj;
    var eventObj:itemEvent = new
    itemEvent(selectedItem,"itemSelected"«»);
    dispatchEvent(eventObj);
    ]]>
    </mx:«»Script>
    <mx:Image source="assets/btnAddItem.jpg"
    click="addItem(data)"/>
    <mx:Text htmlText="{data.consumableLabel}"
    height="45"/>
    <mx:Image source="assets/btnInfoItem.jpg"
    horizontalAlign="right">
    <mx:toolTip>
    {data.consumableLabel}
    Partnumber:{data.consumablePartnr}
    Price:{data.consumablePrice}
    Omschrijving
    {data.consumableDescr}</mx:toolTip>
    </mx:Image>
    </mx:HBox>[/code:1]

    Override clone() method inside event to make sure you take into account the bubbling property, and then inside renderer dispatch the event with bubbling property set to true.
    Alternatively you can dispatch on the list e.g :
    owner.dispatchEvent(newCopyProductEvent(CopyProductEvent.COPY_PRODUCT,o));
    If you choose to do the latter make sure you don;t get into an infinite loop inside list if you decide to redispatch from there,
    C

  • Can you dispatch events from a custom component skin?

    If so, how?
    Thanks~Benny

    I'm curious to know if this is possible as well (or really the question should be, is there a non-hackish way to get a reference to the skin instance)?
    When I've needed to do something like this, I've always just dispatched an event off a skin part from within my skin. IE.
    this.contentGroup.dispatchEvent(...)
    Then I would just listen for the event on the skin part.
    This is a bit hackish, so it would be nice if someone could share a better solution. I've been meaning to look into it, just never have been able to justify the time looking for a better solution.

Maybe you are looking for

  • Why are contacts that I create on my MacBook not syncing in iCloud  on iphone 4S?

    Contacts that I create in "Contacts" on my MacBook Pro Retina are not syncing up through iCloud on my iPhone 4s.  My MacBook is running OSX 10.8 and iPhone is running  5.1.1 Before you say the obvious.......YES, I checked the new contact to be groupe

  • When I delete email items they repeatedly keep coming back as new mail.  How do I stop this?

    After I downloaded the latest operating system, deleted old emails keep reappearing in my inbox.  It takes several tries at deleting to get rid of them.  They also go into my Outlook on the desktop so that I can print and save  documents.

  • Application server connection issue with jdev

    Hi, we have a fusion application instance, deployed in amazon cloud. I am able to connect to this instance/console using the browser. I am able to login to weblogic - console, so credentials and everything is correct, now when I am giving same inform

  • Compiler/jre issues

    I'm confused and need help. Can someone explain how I figure out what 'compiler' I'm using. I have Netbeans 3.6 installed on XP(default install), and also what JRE the output classes would be compatible with. I've been told you can specify this but I

  • I need a MC to loop that is inside a MC...

    I would like play head of a movie clip to return to a certain frame of that clip so a MC inside it would loop. I now have: stop(); as the action. Thanks