Mobile IconItemRenderer - prevent event propagation

Hello,
I don't want anything to happen when an element is clicked or touched in a mobile itemRenderer extending IconItemRenderer.
Isteand of overriding the drawBackground method and not listening for the change event, is there anyway of doing this faster, like preventing the event from propagating?
Thank you.

1. commitProperties seems fine
2. I assume it would be faster since you avoid unnecessary drawBackground calls.  You might want to test to make sure.
3. Correct, if you can't click on something it won't be able to fire a mouseDown event
4. The mouseDown listener is added to the renderer in List.dataGroup_rendererAddHandler.  You could tweak it there, but that would require a subclass of List.  I typically find it easier to do from within the renderer via one of the two approaches I mentioned above especially when that changes based on the data in the renderer.
5. The Flex SDK currently deals exclusively with mouse events.  See the "Mouse vs. Touch Events" section of this spec for more information: http://opensource.adobe.com/wiki/display/flexsdk/Mobile+List%2C+Scroller+and+Touch

Similar Messages

  • Mobile IconItemRenderer broken for iconFields?

    I have a mobile application needing IconItemRenderer to list a bunch of lines,
    each with their own icon (depending on some item state), which is exactly what IconItemRenderer is designed for.
    1) in the itemRenderer, i can define a right-hand decorator icon (but it is always the same for every line):
                  decorator="@Embed(source='icons/xyz.png')"/>
    - -  that works in desktop and Mobile application
    2) I can add dataProvider items to the list, defining thier *individual* left-hand icon and label:
                  myCollection.addItem( {"name":"someText" ,"image":"@Embed(source='icons/xyz.png')" } );
    -- that displays properly in desktop SWT *if* the icon is
                 "icons/xyz.png"
    -- but *not* if the icon is
                 "@Embed(source='icons/xyz.png')"
    -- and no format works for mobile SWT
    3a) i found an adobe help example, but all it has for mobile IconItemRenderer is DECORATORS
    http://help.adobe.com/en_US/flex/using/WSc2368ca491e3ff92-1483ec4a12136246e76-8000.html#WS 77c1dbb1bd80d3836663fb6012af31eb8a5-8000
    -- conspicuous by its absence is setting the icon field, which is fundamentally why one would use the IconItemRenderer.
    WHAT GIVES?  does adobe know that this function is broken?
    How do i get the Item Icons defined and embedded into a MOBILE SWT ??
    - I am using production Flex SDK 4.5.1, and AIR 3.1 on Windows and Android
    ADDENDUM:
    4) *if* i store my list items in a static definition, the icons display correctly on mobile+desktop:
      <s:dataProvider> <s:ArrayList>      <fx:Object name="aaa bbb" image="@Embed('icons/ON.gif')" />
          <fx:Object name="ccc ddd" image="@Embed('icons/OFF.gif')" />
       </s:ArrayList> </s:dataProvider>
    5) but as noted above, in the real world i need to dynamically build the list contents and *the* it does not work
         myDataCollection.addItem( { "name" : "eee fff", "image : "@Embed('icons/ON.gif')" } );
         myDataCollection.addItem( { "name" : "ggg hhh", "image : "@Embed('icons/ON.gif')" } );
    SOLUTION / WORKAROUND:
    The *only* way to get the mobile icon to work, also mantains desktop icon working:
         [Embed("icons/ON.gif")]
         public var onImgCls:Class;
         var icn:Class = offImgCls;
         myDataColl.addItem( {"name":line.substr(0,99), "image":icn} );

    You need to create one of the following internal DNS records:
    Record type
    Host name or SRV definition
    Resolves to
    CNAME
    lyncdiscoverinternal.<sipdomain>
    Internal Web Services fully qualified domain name (FQDN)   for your Director pool, if you have one, or for your Front End pool if you do   not have a Director
    A (host)
    lyncdiscoverinternal.<sipdomain>
    Internal Web Services IP address (virtual IP (VIP) address   if you use a load balancer) of your Director pool, if you have one, or of   your Front End pool if you do not have
    a Director
    You need to create DNS A and AAAA (if you are using IPv6 addressing) records for Front End pool name.
    Lisa Zheng
    TechNet Community Support

  • Event propagation

    Hi,
    SAP has standard functionality of event propagation from FU to FB and vice versa.Now if I want to stop event propagation or event cascading functionality from FB to FU do I need to remove any code logic check in the extractor? Can you elaborate in details here.
    Secondly how does preprocessing functionality help in ENM functionality. What specific checks can eb brought about if w ewant to implement this functionality

    Hi Dipak,
    Extract the FU number as TOR_TEC tracking id from TM shown below
    FU EH TRacking ID table
    Tr.Code.Set
    Tracking id
    FU
    123456
    TRQ
    987563
    TO
    458796
    TOR_TEC
    123456
    Define the Tracking id Code Set(TOR_TEC) in Event reporting items under event message profile , configure only to particular internal event code which does not requires event propagation to FB.
    Above configuration supported only when the event posted via EM WebUI,
    you have to apply the same logic in BADI for interface event posting.
    Regards
    Sukumar

  • [svn:fx-trunk] 9215: Event Propagation bug fix

    Revision: 9215
    Author:   [email protected]
    Date:     2009-08-10 17:30:21 -0700 (Mon, 10 Aug 2009)
    Log Message:
    Event Propagation bug fix
    http://bugs.adobe.com/jira/browse/SDK-21044 - Spark Components should use event.preventDefault instead of event.stopPropagation
    Since keyboard are now cancellable, the Spark components should use event.preventDefault() / event.isDefaultPrevented()  instead of event.stopPropagation. I updated ButtonBar, RadioButton, and DropDownList to use preventDefault(). Also cleaned up Slider and Spinner to always assume the event is cancellable.
    QE notes: Add tests with these components inside of scrollable containers
    Doc notes: None
    Bugs: SDK-21044
    Reviewer: Hans
    Tests run: Slider, Spinner, RadioButton, ButtonBar, DropDownList
    Is noteworthy for integration: No
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-21044
        http://bugs.adobe.com/jira/browse/SDK-21044
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/ButtonBar.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/RadioButton.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Spinner.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/DropDownCont roller.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/Slider.as

    error dateField not selecion date 27/11/2002 ?
    This is bug flex 3 ?
    thanks

  • Stopping Event Propagation

    Hi All,
    Am facing some issue in event propagation.
    I have a Application component with in which I have a link button. The Application has a mouseDown event listening for it and the link button has the click event listening for it.
    I have a requirement where in if i click on the link button i got to show an image and on again clicking on the link button hiding the image. Basically toggling the hide/show of image on click of the link button. This works fine as expected.
    Now I have mouseDown listening on the Application, where in If I click any where else in the Application again the Image show be hidden and only on click of Link button it should be shown.
    But since I have the mouseDown listening on the Application, whenever I click on the Link button the image is showing properly but then after that when I click the link button again to hide the image, then since two events are getting triggered  the Image is never getting hidden. It always shows up.
    THE FIX I NEED is that when i click on the link button, the parent event should be stopped from bubbling and hence only the Link Button's Click should be called and not the Application's mouseDown.. And in else other places, its fine to have the Application's mouseDown event called.
    I Tried event.stopPropagation () and event.stopImme()...but in vain.......... PLS HELP

    "Jimmy Jeeves" <[email protected]> wrote in
    message
    news:g8va3c$ak4$[email protected]..
    > Hi!
    >
    > I want to provide hotkey in my html webpage. (I am using
    >
    http://code.google.com/p/js-hotkeys/)
    > I also have a chat module in Flex. When I am typing some
    text in the flash
    > object, I don't want the hotkeys to be enabled.
    >
    > I tried to stop the propagation from the flash but it's
    not working.
    >
    > From what I know, the html events are propagated from
    the child to the
    > parents. So if I stop the event from my flash object it
    has to be ok,
    > right?
    >
    > See my example. If I display an Alert from the callback,
    it is displayed,
    > so
    > it works. Why the event is still propagated?
    >
    > Thanks
    >
    > public function reportKeyDown(event:KeyboardEvent):void
    > event.preventDefault();
    > event.stopPropagation();
    > }
    >
    > this.addEventListener(KeyboardEvent.KEY_DOWN,
    reportKeyDown);
    >
    I don't think you can preventDefault on key events. You could
    probably use
    ExternalInterface to tell the web page not to listen for the
    hot keys for a
    while, though.
    HTH;
    Amy

  • Programmatically change GUI controls/ prevent event firing

    Hi,
    I often construct GUIs where user input in one control automatically changes other controls.
    A (simple) example:
    A GUI contains controls A and B. When the user changes control A the value of control B has to be adjusted, and the other way round. So the event handler of A tells B to change its value. An event is fired, and the event handler of B tells A to change its value. An event is fired... and you have an endless event handling loop.
    Please believe me, though the example is simple: this happens frequently in real life, too. Since setting Swing controls programmatically most often triggers events, I need a mechanism to prevent event handling loops. What I do so far is
    o set a "deaf" flag
    o change the control
    o the listener gets informed about the change, but since the "deaf" flag is set it does nothing
    o reset the "deaf" flag
    Another, equally awkward way, is removing event listeners before the change and reattaching them afterwards.
    Is there any elegant way to handle this? How do you handle this kind of problem, which can't be too rare in the GUI world (although a rather extensive search with Google did not find much)?
    Chris

    Personally, I usually choose the same approach as you did, implementing a flag which I'll check when events are fired. If you do this, however, be sure to make the flag volatile, otherwise it might (very rarely) happen that a thread caches the value (even though this points to faulty code on your side, it is well near impossible to debug). I would strongly recomment not to remove and readd the listeners since it will create a lot of overhead and is rather hard to maintain.

  • Event propagation API

    Hi,
    I recently started using Flex and read through the, very extensive and well written documentation. I read about the event propagation mechanism and was rather stunned that only Objects that have a parent-child relationship take part in event propagation. At first I couldn't believe it but trying to connect to objects that were at very different parts of the display list showed, that the events really do not get delivered! Wouldn't it be better to have a more general mechanism that does not care about the wherabouts of the components? I mean, what if I want to synchronize some model objects that are not even part of the display list with some UI Element they have a relationship with? The target phase doesn't work because its not the model that throws the event (of course!). Or do I miss something here?
    I was expecting a more subject-observer like pattern,  that allows me to connect whatever I want with whatever there is left. So, how do I do that. Do I have to right my own little event dispatching library (what would not be so difficult, but I would rather use something that has already proven its liability)? Can anybody recommend me a good API for that or tell me that I am dead wrong and missing something important?
    Regards,
    Benni

    Only DisplayObjects support bubble and capture propagation.  In a tree of
    regular Objects, as long as you attach a listener to the right object, you
    will be able to get its events.
    Bubble and capture are very dangerous as they break encapsulation.  We only
    use them for situations where the target is unpredictable like in mouse and
    keyboard interaction.  I would probably not use it in a data object tree.
    Maybe if you provide a more explicit example of what you are trying to
    accomplish and what you tried, folks on the forum can help.

  • JTable: how to prevent events?

    Hello friends...
    Does somebody know how to prevent a JTable to fire events at certain times when selections are made?
    In this case, the selection can be made externally to the table, by a lot of objects at the same time. The goal is to fire an event ONLY when I really need it...
    ThanX in advance for any help...

    Hello again...
    ThanX for your answers, I used a mix of both.
    I used the method .setValueIsAdjusting() in ListSelectionModel that considers all coming events as one and I used a flag to enable changes.
    The problem now is, I get a big array of values the table has to handle. Since it handles it as one unique event, it should be OK. But I fear that if the array is really monstruous, the method .setValueIsAdjusting() enters in "wait" mode (multi threads and all the stuff) and the flag is set to true (changes possible) without changes being made to table... Perhaps, there would be no problem at all...
    Is it possible to force .setValueIsAdjusting() to do his job immediately?
    ThanX a lot for your time...

  • PreventDefault MouseDown on a mobile IconItemRenderer

    Hi,
    I trying to cancel the mouseDown on custom itemrenderer that extends IconItemRenderer when it's on a certain state.
    I add a state that named 'control'
                  _controlState = new State()
                                  _controlState.name = 'control'
                                  _controlOverride = new Array()
                                  var requestAddChild:AddChild = new AddChild(this,_requestIndicator)
                                  var controlAddChild:AddChild = new AddChild(this,_controlLabel)
                   var downEventHandler:SetEventHandler = new SetEventHandler(this,MouseEvent.MOUSE_DOWN)
                   downEventHandler.target = this
                   downEventHandler.handlerFunction = controlDownHandler
                   this.states.push(_controlState);
    and the controlDownHandler function follow
                   protected function controlDownHandler (e:MouseEvent):void {
                                            e.preventDefault()
                             e.stopPropagation()
                                            //dispatchEvent(new DataRequestEvents(DataRequestEvents.DATA_REQUEST,true))
    But the default MOUSE_DOWN event are not stoped. I've also tryed to simply add an EventListener.
    I've alos tried to simply add an event listener inside overriden method createChildren:
              this.addEventListener(MouseEvent.MOUSE_DOWN,controlDownHandler
              protected function controlDownHandler (e:MouseEvent):void {
                             if (!dragging){
                                  e.preventDefault()
                                  e.stopPropagation()
                                  //dispatchEvent(new DataRequestEvents(DataRequestEvents.DATA_REQUEST,true))
    But, in this case, i can't drag the list up or down
    Is there a way to reach this goal ?
    Thank for helping .

    Hi  Flex harUI!
    I've a list that display the 12 more recent news.
    My final goal is to add an itemRenderer at the end of the list that can call a service that get older news.
    1- The classic item render with default MOUSE_DOWN event. (call another view)
    2 -The added itemRenderer that preventDefault() and call the service
    Everything work fine exept that i can avoid the MOUSE_DOWN event on this particular renderer.

  • Embed Fonts in mobile IconItemRenderer

    Hi everybody,
    I developed a mobile app whose lists use a custom item render extended from the IconItemRenderer component.
    Everything works fine except for the fonts. It does not display the right font, which is embedded via CSS.
    Here is what the component does :
    override public function set data(value:Object):void
         super.data = value;          
         labelDisplay.setStyle("fontFamily", "MyFont");
         labelDisplay.setStyle("fontWeight", "normal");
    And this is my CSS
    @font-face
         src: url("../assets/fonts/MyFont.ttf");
         fontFamily: "MyFont";
         fontWeight: normal;
    My item renderer keeps on displaying the default font.
    Am I missing something ?
    Thanks

    Hi there,
    Try taking a look at the following links:
    http://www.trajiklyhip.com/blog/index.cfm/2007/7/18/Embedding-Fonts-in-Flex
    http://blog.flexexamples.com/2007/10/25/embedding-fonts-from-a-flash-swf-file-into-a-flex- application/
    Hope it helps.
    With best regards,
    Barna Biro

  • Event propagation in mediumweight components

    Hi,
    There's an article "Mixing heavy and light components":
    http://java.sun.com/products/jfc/tsc/articles/mixing/
    It explains mouse event handling:
    "Mouse events on a lightweight component fall through to its parent; mouse events on a heavyweight component do not fall through to its parent. "
    What about mediumweight components? Are mediumweight components receiving mouse events like lightweight or like heavyweight components?
    Is it possible to infer how the mouse events are propagated just by using JComponent.isLightweightComponent()?
    Kari

    What do you mean by sub-app .  Are you using modules ?  For regular situations you can set "bubbles" to true on the event.

  • Help with understanding key event propagation

    Hello,
    I am hoping someone can help me understand a few things which are not clear to me with respect to handling of key events by Swing components. My understanding is summarized as:
    (1) Components have 3 input maps which map keys to actions
    one for when they are the focused component
    one for when they are an ancestor of the focused component
    one for when they are in the same window as the focused component
    (2) Components have a single action map which contains actions to be fired by key events
    (3) Key events go to the currently focused component
    (4) Key events are consumed by the first matching action that is found
    (5) Key events are sent up the containment hierarchy up to the window (in which case components with a matching mapping in the WHEN_IN_FOCUSED_WINDOW map are searched for)
    (6) The first matching action handles the event which does not propagate further
    I have a test class (source below) and I obtained the following console output:
    Printing keyboard map for Cancel button
    Level 0
    Key: pressed C
    Key: released SPACE
    Key: pressed SPACE
    Level 1
    Key: pressed SPACE
    Key: released SPACE
    Printing keyboard map for Save button
    Level 0
    Key: pressed SPACE
    Key: released SPACE
    Level 1
    Key: pressed SPACE
    Key: released SPACE
    Printing keyboard map for Main panel
    Event: cancel // typed SPACE with Cancel button having focus
    Event: save // typed SPACE with Save button having focus
    Event: panel // typed 'C' with panel having focus
    Event: panel // typed 'C' with Cancel button having focus
    Event: panel // typed 'C' with Save button having focus
    I do not understand the following aspects of its behaviour (tested on MacOSX although I believe the behaviour is not platform dependent):
    (1) I assume that the actions are mapped to SPACE since the spacebar clicks the focused component but I don't explicitly set it?
    (2) assuming (1) is as I described why are there two mappings, one for key pressed and one for key released yet the 'C' key action only has a key pressed set?
    (3) assuming (1) and (2) are true then why don't I get the action fired twice when I typed the spacebar, once when I pressed SPACE and again when I released SPACE?
    (4) I read that adding a dummy action with the value "none" (i.e. the action is the string 'none') should hide the underlying mappings for the given key, 'C' the my example so why when I focus the Cancel button and press the 'C' key do I get a console message from the underlying panel action (the last but one line in the output)?
    Any help appreciated. The source is:
    import javax.swing.*;
    public class FocusTest extends JFrame {
         public FocusTest ()     {
              initComponents();
              setTitle ("FocusTest");
              setLocationRelativeTo (null);
              setSize(325, 160);
              setVisible (true);
         public static void main (String[] args) {
              new FocusTest();
    private void initComponents()
         JPanel panTop = new JPanel();
              panTop.setBackground (java.awt.Color.RED);
    JLabel lblBanner = new javax.swing.JLabel ("PROPERTY TABLE");
    lblBanner.setFont(new java.awt.Font ("Lucida Grande", 1, 14));
    lblBanner.setHorizontalAlignment (javax.swing.SwingConstants.CENTER);
              panTop.add (lblBanner);
              JPanel panMain = new JPanel ();
              JLabel lblKey = new JLabel ("Key:");
              lblKey.setFocusable (true);
              JLabel lblValue = new JLabel ("Value:");
    JTextField tfKey = new JTextField(20);
    JTextField tfValue = new JTextField(20);
    JButton btnCancel = new JButton (createAction("cancel"));     // Add a cancel action.
    JButton btnSave = new JButton (createAction("save"));          // Add a sve action.
              panMain.add (lblKey);
              panMain.add (tfKey);
              panMain.add (lblValue);
              panMain.add (tfValue);
              panMain.add (btnCancel);
              panMain.add (btnSave);
              add (panTop, java.awt.BorderLayout.NORTH);
              add (panMain, java.awt.BorderLayout.CENTER);
    setDefaultCloseOperation (javax.swing.WindowConstants.EXIT_ON_CLOSE);
    // Add an action to the panel for the C key.
              panMain.getInputMap (JComponent.WHEN_IN_FOCUSED_WINDOW).put (KeyStroke.getKeyStroke (java.awt.event.KeyEvent.VK_C, 0), "panel");
              panMain.getActionMap ().put ("panel", createAction("panel"));
              // FAILS ???
              // Add an empty action to the Cancel button to block the underlying panel C key action.
    btnCancel.getInputMap().put (KeyStroke.getKeyStroke (java.awt.event.KeyEvent.VK_C, 0), "none");
    // Print out the input map contents for the Cancel and Save buttons.
    System.out.println ("\nPrinting keyboard map for Cancel button");
    printInputMaps (btnCancel);
    System.out.println ("\nPrinting keyboard map for Save button");
    printInputMaps (btnSave);
              // FAILS NullPointer because the map contents are null ???
    System.out.println ("\nPrinting keyboard map for Main panel");
    // printInputMaps (panMain);
    private AbstractAction createAction (final String actionName) {
         return new AbstractAction (actionName) {
              public void actionPerformed (java.awt.event.ActionEvent evt) {
                   System.out.println ("Event: " + actionName);
    private void printInputMaps (JComponent comp) {
         InputMap map = comp.getInputMap();
         printInputMap (map, 0);
    private void printInputMap (InputMap map, int level) {
         System.out.println ("Level " + level);
         InputMap parent = map.getParent();
         Object[] keys = map.allKeys();
         for (Object key : keys) {
              if (key.equals (parent)) {
                   continue;
              System.out.println ("Key: " + key);
         if (parent != null) {
              level++;
              printInputMap (parent, level);
    Thanks,
    Tim Mowlem

    Use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the posted code retains its original formatting.
    1) In the Metal LAF the space bar activates the button. In the Windows LAF the Enter key is used to activate the button. Therefore these bindings are added by the LAF.
    2) The pressed binding paints the button in its pressed state. The released binding paint the button in its normal state. Thats why the LAF adds two bindings.
    In your case you only added a single binding.
    3) The ActionEvent is only fired when the key is released. Same as a mouse click. You can hold the mouse down as long as you want and the ActionEvent isn't generated until you release the mouse. In fact, if you move the mouse off of the button before releasing the button, the ActionEvent isn't even fired at all. The mouse pressed/released my be generated by the same component.
    4) Read (or reread) the [url http://java.sun.com/docs/books/tutorial/uiswing/misc/keybinding.html#howto]How to Remove Key Bindings section. "none" is only used to override the default action of a component, it does not prevent the key stroke from being passed on to its parent.

  • [2008R2] Prevent event : The shadow copies of volume D: were deleted because the shadow copy storage could not grow in time

    During the restore of data using VSS Snapshots it deleted all the snapshots, this event was written in the system log : 
    The shadow copies of volume D: were deleted because the shadow copy storage could not grow in time.  Consider reducing the IO load on the system or choose a shadow copy storage volume that is not being shadow copied.
    It only restored 20 GB of data and there should be plenty of space in the Shadow copy storage
    Used Shadow Copy Storage space: 2.692 GB (0%)
    Allocated Shadow Copy Storage space: 5.397 GB (0%)
    Maximum Shadow Copy Storage space: 694.752 GB (18%)
    When there isn't enough space it should start to delete the oldest snapshots to free up additional space, but it deleted
    all the snapshots. The problem is the IO but how to prevent this from happening again?

    Hi,
    Since the shadow copy storage space doesn’t run out, the issue could be due to the Volsnap.sys driver has encountered excessive I/O activity.
    You could refet to the article below to resolve the issue. This article is for Windows 2003 but it will also help on Windows 2008 R2 system.
    Error message when a Windows Server 2003-based computer has a high level of I/O activity: "The shadow copies of volume Volume_Name were aborted because the diff area file could not grow in time"
    http://support.microsoft.com/kb/925799
    Best Regards,
    Mandy 
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Stopping an event propagation

    Hi!
    I want to provide hotkey in my html webpage. (I am using
    http://code.google.com/p/js-hotkeys/)
    I also have a chat module in Flex. When I am typing some text
    in the flash object, I don't want the hotkeys to be enabled.
    I tried to stop the propagation from the flash but it's not
    working.
    From what I know, the html events are propagated from the
    child to the parents. So if I stop the event from my flash object
    it has to be ok, right?
    See my example. If I display an Alert from the callback, it
    is displayed, so it works. Why the event is still propagated?
    Thanks

    "Jimmy Jeeves" <[email protected]> wrote in
    message
    news:g8va3c$ak4$[email protected]..
    > Hi!
    >
    > I want to provide hotkey in my html webpage. (I am using
    >
    http://code.google.com/p/js-hotkeys/)
    > I also have a chat module in Flex. When I am typing some
    text in the flash
    > object, I don't want the hotkeys to be enabled.
    >
    > I tried to stop the propagation from the flash but it's
    not working.
    >
    > From what I know, the html events are propagated from
    the child to the
    > parents. So if I stop the event from my flash object it
    has to be ok,
    > right?
    >
    > See my example. If I display an Alert from the callback,
    it is displayed,
    > so
    > it works. Why the event is still propagated?
    >
    > Thanks
    >
    > public function reportKeyDown(event:KeyboardEvent):void
    > event.preventDefault();
    > event.stopPropagation();
    > }
    >
    > this.addEventListener(KeyboardEvent.KEY_DOWN,
    reportKeyDown);
    >
    I don't think you can preventDefault on key events. You could
    probably use
    ExternalInterface to tell the web page not to listen for the
    hot keys for a
    while, though.
    HTH;
    Amy

  • Event Propagation again. Sorry

    Hi guys, I vave a pretty simple app to test how the propagation works.I do not undestand, why the propagation on the stage 3 (bubbling) works in the oppsit way than it should work.
    Here is my code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
                xmlns:view="view.*" initialize="init()">
    <mx:Script>
    <![CDATA[
         import mx.controls.Label;
         import mx.events.FlexEvent;
         import mx.controls.Button;
         import mx.controls.Alert;
         import flash.events.TextEvent;
         private function init():void {
              this.addEventListener(MouseEvent.CLICK, handleTestEvent);
              vBox2.addEventListener(MouseEvent.CLICK, handleTestEvent2);
              vBox1.addEventListener(MouseEvent.CLICK, handleTestEvent1);
         private function handleTestEvent2(event:MouseEvent):void {
              Alert.show("This is VBox2  " + event.eventPhase );
         private function handleTestEvent1(event:MouseEvent):void {
              Alert.show("This is VBox1  " + event.eventPhase);
         private function handleTestEvent(event:MouseEvent):void {
              Alert.show("This is Application  " + event.eventPhase);
    ]]>
         </mx:Script>
              <mx:VBox id="vBox2">
                   <mx:VBox id="vBox1">
                        <mx:Button id="testButton" label="Click Me" />
                   </mx:VBox>
              </mx:VBox>
         </mx:Application>
    So, when I run this application, the first popup I see is: This is Application 3. Then: This is VBox2 3  and the last one: This is VBox1 3. But as I understud the order should be: This is VBox1 3,  This is VBox2 3,  This is Application 3.
    Could some body explain what's wrong?
    Thanks.

    The Alert boxes sit on the top of the display.
    When you get the first alert, it appears over the content.
    When the second happens it sits over the first alert.
    Then the third happens and sits over the second.
    So, when you see the third alert, it looks like there is only one box, but there are two underneath - hidden.
    You dismiss the third alert and see the second.
    You dismiss the second and see the first.
    It looks like the order is reversed, but in fact the order is correct and they have just popped up over each other. It feels that dismissing the third alert causes the second alert to popup, but it doesn't - it was there all along.
    Alert isn't synchronous.

Maybe you are looking for