Event Flow

Hi!
If i have a container, with some sprites and this sprites containes other sprites, wich is the best way to target the Event to the second level of sprite?
Container:
- sprite1 ---> contain n sprite
- sprite 2 --> contain n sprite
- sprite 3 --> contain n sprite
- sprite n --> contain n sprite
container.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownListener);
private function mouseDownListener(event:MouseEvent):void {
     //in here i want to get the red one             
thanks!

I realize what you want, but that is probably not the best (most reliable) way to be able to do that.  To target what is inside the container while assigning the listener to the container, your only option is to use the 'target' property of the event, which can end up targeting just about anything inside the container at any level.  So what you probably need to try is to make all of the subSprites inside the red sprites immune to the mouse (set red sprite's mouseChildren property to be false).  Otherwise, the target could be any of the Sprites/objects within the red Sprites.

Similar Messages

  • Flash CS4 - how to create event flow from children to parents?

    In my opinion natural event flow direction is from children
    to its parants.
    E.g. when in dialog box buttons are pressed it is natural to
    inform only
    this dialog box about these actions. When dialog box can't
    handle particular
    event then passes it to its parent and so on .
    Unfortunately this direction is not well supported by Flash.
    To achieve
    support for this event direction it is necessary to call
    parent.dispatchEvent() with bubbling option off. This
    solution is
    inconvenient because sometimes I can't predict what event
    types will be
    triggered inside dialog components. Most likely there is no
    function to
    catch all events which have no defined handlers in dialog in
    order to be
    possible to pass them one level higher.
    Have you got any experience with building communication model
    between
    objects in Flash applications?
    Regards,
    Marek

    XML shema is basically an XML file. So u need to know how to create an XML,
    provided u know how the shema file should be.
    Creating an XML :
    http://forum.java.sun.com/thread.jspa?threadID=5181031&messageID=9705786#9705786

  • Dispaly Object Exclude from Event Flow

    Hi!
    I m building a little application, im design the graphic in Flash and im using Flash Builder for the Programming Side.
    I have 5 MovieClip inside a Sprite (the container), and i want to listen for MOUSE.CLICK.
    I add the event listener to the Sprite, instead of one for MovieClip, and its working good like this.
    What if inside the Sprite (the container) i have also a TextField and exclude it from the event flow?
    Thanks!

    Inside flash i have a movieClip, inside this movieClip(the container) i have 5 other movieClip and e text  (look at the picture):
    i want to trigger mouse click just on the movie cilip and not on the text.
    colorPikerUI.addEventListener(MouseEvent.CLICK,clickPikerListener);
    private function clickPikerListener(e:MouseEvent):void{
                    for(var i:int=0;i<colorPikerUI.numChildren;i++){
                        colorPikerUI.getChildAt(i).alpha = 1;
                    MovieClip(e.target).alpha = .3;
                    var indexColor:int = colorPikerUI.getChildIndex(MovieClip(e.target))
                   trace (indexColor)
    colorPikerUI it's a clip inside the red rectangle!
    Thanks!

  • Help regarding event flow/event listening best practices

    Hi, I'm making a flash memory card game to learn more about
    to actionscript.
    I have:
    - a main class that loads on start. This class instantiates
    a:
    - CardLoader class that imports graphical assets and uses
    these to create all my cards:
    - Card class that represents individual card. Can dispatch
    CardEvent when clicked:
    - CardEvent contains info on the Card that dispatched it,
    such as the cards ID number and the ID of it's matching card.
    What I want to do is to have another object to act as a game
    logic handler.
    Example:
    - Card 1 was clicked, dispatches CardEvent that ends up with
    the LogicHandler.
    - Card 2 was clicked and also dispatches event.
    LogicHandler compares these two cards and does the
    appropriate thing depending on they being a match or not.
    Now, the big questions is, how do I get this event to the
    LogicHandler?
    My custom CardEvent has it's bubbles property set to true.
    So, I can manage to get such an event all the way back to my main
    class, in this order: CardEvent > Card > CardLoader >
    Main.
    The problem arises when I want to have my LogicHandler class
    created by Main. When my CardEvent bubbles back, it does not go
    through this LogicHandler since it is not part of the event flow on
    it's way back.
    Questions: How do I, following the best possible programming
    practises, send the event the way I want it to go?
    I can only think of one solution myself, being that inside my
    Main method I set up an eventlistener that listens for this event
    and passes it on downwards, in this case to the LogicHandler. Sure,
    it's only a few lines of code in the main method, but what if you
    have 50 different events in a larger project that needs the same
    treatment?
    Your main method will be a mess by then!
    How would you do it?

    Ok let me see if I get this straight:
    In my example, I would have to pass a reference of the
    LogicHandler to my Card class.
    In my Card class, I have something like:
    logicHandler.addDispatcher(this);
    this being the Card of course.
    Inside LogicHandler class I have the addDispatcher method
    that calls the addEventListener method.
    So far so good?
    The addDispatcher method adds an eventlistener to the Card
    object, from what I can tell. But it does it inside the
    LogicHandler, thus the method that is called by the
    addEventListener can be inside the LogicHandler?
    To put it in other words, what's confusing me is that the
    Listener object adds an EventListener to the dispatching object.
    Logically for me the listener should add a listener to itself?
    The way I first did it in my Card class was:
    testevent = new CardEvent(CardEvent.CLICK);
    dispatchEvent(testevent);
    And then set up the EventListener in the object that I wanted
    to receive the event.
    I'm sorry I don't understand this, despite your obviously
    good explanations (I think I understand a lot more now, just not
    the best approach). I will look into the callback functions, sounds
    a lot interesting as well

  • Regarding Event Flow in Flex.

    Hi all,
               i have a doubt may be silly but i need an clear idea on this,
               Actually coming to events the event flow occurs in 3 phases capturing,targeting and bubbling phases.
               Now suppose inside my application (Main Application ) i have an VBox and inside that i have Hbox and inside Hbox i have Button .
              Suppose now when the user clicks button first what phase will it check wether will it be checking for capturing or bubbling or targeting ?
              i want to know first what phase will it check?
             Sorry for my poor english.

    The main app's capture listener will be first, followed by the hbox capture
    listener, then the button target listener, then the hbox bubble listener
    then the main app's bubble listener.

  • As3 event flow, and a rant

    ok, more rant than help, if i dont find the answer here ill probably think of something in the morning but at least i get to vent some. the geniuses of adobe tried to to an event handling closer to traditional programming, only different in every aspect. ok, event handling, wow, lets do something that is not like common declarative languajes (c, c#, java etc), or that looks similar to at least as2, so lets create an event handling thats is not close to anything else, and instead of specifying or 'turn on' the right flow of the event, let the user 'turn off' all the cases that are not the ones he/she wants (that should keep things interesting), so instead of, if i want to pass an event to a container form the control or sprite that gets it, lets create an event that goes from all controls from the inside to all conatiners, and that does not stop unless the user specifically specifies to stop propagating, so let the user create an event handler for a control that should not need an event handler so it does not propagate, and lets make some useless help in the manual aboput some babbling, i mean bubblibng, and lets spit and let the user imagine whatever we could not do right in design time. in other words, lets be creative.
    i have a text field, if i want it to receive input i have to set it to 'mouseenabled=true', and if it has mouseenabled=true, it will propagate the click event (when user clicks over textfield to set focus on it) to the stage or whatever container it has.
    so the stage or container or whatever receives a click event, but oh lucky, it gets the parameters relative to the object which got the event in the first place, not relative to the stage (so if the user clicks on the text field, and even though the textfield handled the event, it will propagate the click to whatever sprite contains the textfield, and will be handled by those handlers). so the user clicks on the textfield, the textfield gets focus or whatever, and then withoput specifying to propagate the event, it will pass it to the stage. the stage gets the mouse click, but instead of the stage coordinates, it gets the click with coordinates relative to the textfield (so if the textfiled was clicked on x=10, y=10 relative to itself, the stage will get a click event with x=10 and y=10, evenn if relative to the stage the coordinates where something different -they should be the same only if the textfield was in 0, 0, which is not the case- ). ok, the damage is done, so lets learn how to stop the 'bubbling', and lets make guesses since besides of designing it with thier feet, the other geniuses of adobe could not even write it right in the manual. is there at least in the mouseevent object some property that says who was the original caller? (if i dont find an answer here soon i will look into it in the morning, but i wanted to say this anyway)

    hmm.. hi, what you said it probably helps, yes it is related to the taget of an event that propagates so you got it right, and i could probably get the atributes from each object in the list, and i wrote the things above because i was pissed at the time (and as i said, i got over it using a mix of stageX and Y with localX and Y). anyway, it does not seem a right way to handle things that instead of stopping in a control that handles the event, and the control having the possibility to propagate it to its containers, do the other way, to have to stop the event from propagating, even though controls and forms and containers and stuff have been treated long enough in many other ides and languajes, and as3 does it all just the contrary of the usual, with having to explicitly stop from 'bubbling', and passing the parameters in the propagation relative to the first object, instead of the current container (so what is the pourpose of this, check the whole list and do the math to find current parameters?), well in any case it was just it, and it was solved. tnx anyway

  • Event flow in ABAP is different when executed via SE80 vs. via TCODE

    Hi,
    We have many existing custom ABAP report pgms that have a custom transaction code that executes them.  Regardless of how the pgms are invoked, the event sequence in the pgm is INITIALIZATION, AT SELECTION-SCREEN, START-OF-SELECTION. etc. 
    Now, when I create a new pgm with a transaction code to invoke it, the event sequence when executing the pgm via SE38 is as before (All 3 events above are triggered).  However when I invoke the pgm via the custom transaction code, only the event At SELECTION-SCREEN is executed.  (Not the INITIALIZATION or the START-OF-SELECTION events).
    We have upgraded our SAP GUI from 6.4 to 7.1.   We are upgrading our system from 46.C to ECC6.  I get this error in ECC6 and also in the old system 46.C which is causing me to question whether the SAP Gui is involved.  We are using SAP GUI 7.1 in both the 46.C and ECC6 systems.
    Any help will be appreciated!
    Thanks,
    Deb

    Hi All,
    Here is my ABAP Code.  I have put break points in the code so I can track the sequence.
    REPORT ZDEBNEW .
    data zdeb(2) type c.
    tables kna1.
    SELECTION-SCREEN BEGIN OF BLOCK A WITH FRAME TITLE TEXT-002.
    SELECT-OPTIONS: I_KTOKD for KNA1-KTOKD.
    SELECTION-SCREEN END OF BLOCK A.
    INITIALIZATION.
      zdeb = '1'.   "break
      sy-subrc = sy-subrc.
    PAI
    AT SELECTION-SCREEN.
      zdeb = '2'.  "break
      sy-subrc = sy-subrc.
    START-OF-SELECTION.
      zdeb = '3'.  "break
      sy-subrc = sy-subrc.
    END-OF-SELECTION.
      zdeb = '4'.   "break
      sy-subrc = sy-subrc.
    As for the type of transaction I am using...I created it via SE93 and specify SELECTION SCREEN 1000.  I classify it as a Professional User transaction.  One other thing I have noticed is that when I view the new pgm via SE80 I do not see Screen 1000 in the left navigation panel.  If I try to create such a screen in SE80, it says it already exists.  I can see Screen 1000 from tran SE51.  In one of the existing old pgms, I do see screen 1000 when I view SE80.
    Thanks for the help and interest!!!

  • How can I add new event handler in BC4J event flow in UIX?

    How can I declarativly add extension to existing event handleres in BC4J+UIX page?
    I generate through wizards UIX+BC4J pages and I want extend some actions in eventhandlers section. Can I do it in some way like <event name=".." method=".." class=".."> like in any regular event handlers?

    you can use the <method ..> event handler inside the BC4J event handlers, like:
    <bc4j:findRootAppModule name="EmpAppModule" >
    <bc4j:findViewObject name="CurrentDeptEmpsVO" >
    <method class="myPackage.myClass" method="doOperation"/>
    </bc4j:findViewObject>
    </bc4j:findRootAppModule>

  • BPM 11g - Human task not removed when interrupting boundary event fired

    In BPM 11g (11.1.1.1.3), I am testing a message catch event on the boundary of a human task. It is set for interrupting, so it should, when the event fires, remove the human task from the work list and follow the flow out of the event. The event flow is being followed, but the human task is being left active in the user's work list. I would expect the human task to be removed when the interrupting boundary message event occurs.
    I think this is a bug, but would welcome any suggestions on how to solve it. Does anyone know if this works in the latest release (11.1.1.1.4)? We might upgrade pretty soon. Has anyone else tried boundary message events and gotten them to work properly in BPM 11g?
    Just FYI....in order to make the BPM message event occur and provide instance correlation, we had to add a mediator and BPEL correlation. We followed process documented in a previous post to do this (http://blog.andrade.inf.br/2011/01/implementing-correlation-in-bpm-11gr1.html). Thanks to whomever posted that...it got us a few steps further along!

    I do not think this is bug based on
    Oracle® Fusion Middleware Modeling and Implementation Guide for Oracle Business Process Management
    23.1.1 Understanding the Relationship Between SOA Composites and SOA Components
    "In a similar way, when an interrupting timer or message boundary event arrives to a user task, the BPMN process instance leaves the user task but the associated Human Task remains available. Because the interrupting timer or message boundary event arrived before the user completes the user task, the human task remains unfinished, and you can still access it thought the Worklist application. However running that human task does not have any effect on the BPMN process."
    This also gives us big trouble. I am looking for the solution.
    Helen

  • On Windows 2012,WMIPRVSE.EXE WMI service leaks memory when registering SMO to SQL Server events

    Hi, 
    I have written an application which registers to events using SMO API. 
    I have noticed that after some time, suddenly event flow from SQL Server stops. and I can't event shut down my application properly, as StopEvents() method of SMO hangs the shutdown.
    After further investigation, I have found out that a spawned process (probably by SQL Server) WMIPRVSE.EXE memory grows rapidly. 
    As soon as this process reaches about 482MB ~ 500MB memory consumption. I didn't notice any particular CPU peak for this process. 
    As I manually kill this process, I'm able to shutdown my application properly and even re-register it to events.
    I may add that this issue doesn't happen on an regularly updated Windows 2008. 
    I managed to find this hotfix (the only one for 2012) but it won't install!!! http://support2.microsoft.com/kb/2790831/en-us?lc=1033
    In an act of frustration , I decided to bypass your process, and write a heuristic mechanism to find WMIPRVSE.EXE which is related to my application, and kill it whenever it reaches the mentioned sizes. 
    But it's not the answer. 
    Please provide a proper hotfix for 2012, as you did with Windows 2008, or an answer regarding what is wrong?
    simple search reveals that this process was very problematic in 2008...
    Regards,
    Adi

    Hi Adi,
    à
    I managed to find this hotfix (the only one for 2012) but it won't install!!! http://support2.microsoft.com/kb/2790831/en-us?lc=1033
    Would you please let me know detailed edition information of this server 2012? Was it Windows Server 2012 Standard
    or
    Essentials or any other?
    Based on your description, I understand that
    KB2790831 can’t be installed in that problematic Windows Server 2012. Would you please let me know the error message that you can get when failed to install the Hotfix? Please perform a
    clean boot and check if still can’t install this Hotfix.
    Meanwhile, please check if
    KB2934016 was installed on your Windows Server 2012? If didn’t install, please install this update rollup and check if this issue still exists.
    If any update, please feel free to let me know.
    Hope this helps.
    Best regards,
    Justin Gu

  • Question Events

    Hi All,
    Can anyone please tell me the process that happens behind the following code.
    *& Report  ZMY_TEST_PROGRAM
    REPORT  ZMY_TEST_PROGRAM.
    TABLES : KNA1,
             MARA.
    SELECTION-SCREEN :BEGIN OF BLOCK SC1 WITH FRAME TITLE TEXT-001.
    PARAMETERS : RD1 RADIOBUTTON GROUP RD1 DEFAULT 'X' USER-COMMAND ONLI,
                 RD2 RADIOBUTTON GROUP RD1.
    SELECTION-SCREEN END OF BLOCK SC1.
    data : itab type standard table of mara initial size 10 with header line.
    write 'i am fine'.
    start-of-selection.
    select * from mara into table itab where matnr = '0000001000'.
    loop at itab.
    write :/ itab-matnr.
    endloop.
    top-of-page.
    write 'this is the header'.
    start-of-selection.
    select * from mara into table itab where matnr = '0000001001'.
    loop at itab.
    write :/ itab-matnr.
    endloop.
    In the above code the write statement "i am fine" falls under which event.
    TOP-OF-PAGE is the output event.so how is the control going back to the Start-of-selection once it encounters the write statement.ie.if a write statement is encountered control goes to TOP_OF-PAGE.so how is it able to go back to Start-of-selection
    Also how is the ABAP processor able to process both the Start-of-selection events.
    i am able to get the output of all the write statements.
    so can anyone tell me how the ABAP processor does that work internally.

    Hi,
    flow of events
    load of program
    INITIALIZATION. Before the selection screen is displayed.
    AT SELECTION-SCREEN OUTPUT. Before painting the screen.
    AT SELECTION-SCREEN. Used for validations..
    START-OF-SELECTION. When pressed execute button in the selection-screen. If no selection-screen then executes automatically
    END-OF-SELECTION. Generally used in the logical database. But in normal reporting triggers after start-of-selection. and is the last event triggered before displaying the report.
    AT USER-COMMAND. when user presses button in the list. then this event is triggered
    AT LINE-SELECTION. when double clicked on the list.
    TOP-OF-PAGE. when first write statement is triggered in the program.
    END-OF-PAGE. triggered at the end of the page..
    In whatever order u give events flow in the above order  processor checks and processes them accordingly
    write statement "i am fine" falls under start-of-selection event.
    a start-of-selection event is automatically inserted before write statement
    Regards

  • Error: "Invalid Sequence Flow: it connects a node located in main flow ...

    I have a error in BPM flow:
    Invalid Sequence Flow: it connects a node located in main flow (#1) to a node located in a Boundary Event flow (#2)
    The component is a "Manual Activity" (#1) connected a "Human Task" (#2)
    A another error with the same message is a "Exclusive Gateway" (#1) connected a another "Exclusive Gateway" (#2)
    Can help me?

    Thank you Jasmin and Diego. Your replies made me look carefully at my code and I found that I was not updating the repository with Document without the Policy added. I was doing the following:
    RMSecureDocumentResult protectDoc = documentManager.protectDocument(unproctDoc,                "yabby_traps_kill_platypus.pdf", policySet, lcPolicy.getName(), null, null, null);
    r.getContent().setDataDocument(unproctDoc);
    repositoryClient.updateResource(r.getPath(),r,false);
    Instead I should have been doing the following:
    RMSecureDocumentResult protectDoc = documentManager.protectDocument(unproctDoc,                "yabby_traps_kill_platypus.pdf", policySet, lcPolicy.getName(), null, null, null);
    r.getContent().setDataDocument(protectDoc.getProtectedDoc());
    repositoryClient.updateResource(r.getPath(),r,false);

  • MovieClip does not receive Custom Event

    I have a problem understanding Events and event handling.
    I have a movieClipA wich contains several other movieClips (a1,A2,A3, etc..)
    MovieClipA is parent of movieClips (a1,A2,A3, etc..)
    In movieClipA I use the following code:
    addEventListener ( "Pieter", pieterFnP ) ;
    dispatchEvent(new Event("Pieter"));
    private function pieterFnP (e:Event) {
            trace ("PIETER - Parent");
    } // Is fired when recieving Event
    In movieClips (a1,A2,A3, etc..) I use the code
    addEventListener ( "Pieter", pieterFnC ) ;
    private function pieterFnC (e:Event) {
             trace ("PIETER - Child");
    } // Is NOT fired ?
    When I execute the application, function "pieterFnP" is fired, but "pieterFnC" NOT.
    Thank you.
    Pieter

    In the Flash manuals I see/read; events traveling from the stage down to the object and then bubling up.
    Quote::
    When an event occurs, it moves through the three phases of the event flow: the capture   phase, which flows from the top of the display list hierarchy to the node just before the   target node; the target phase, which comprises the target node; and the bubbling phase,   which flows from the node subsequent to the target node back up the display list hierarchy.
    My First attempt was Capturing events send by the Child objects. But then I had the problem that after the child object was gone, the eventhandler stil existed. Pointing to a null Child object. This behaviour is also described in the Flash manuals. But I never could pin-point which variable (object) still contains a 'reference' ? to the event object.
    So I thougth about a different approach. Which seams to me, was the logical solution, meaning Bubbling down and up.
    My design approach was to define a child DisplayObject, which perform some action, after recieving a event from is parent. So I don't have to keep track of all the created objects. More like the Idea of fire and forget.
    Ok, I go back to my virtual drawing board
    Thanks,
    Pieter

  • Unexpected event target when clicking on a Panel

    Below is a program that I wrote to improve my understanding
    of the event flow. It simply creates a Button within a Panel within
    an Application and registers listeners for each component for both
    capturing and bubbling phases. I understand the output when I click
    outside of the panel or on the button but when I click the panel, I
    get this output:
    listener for application, capture phase, target =
    Evphases0.panel1.UIComponent8.UITextField10, currentTarget =
    Evphases0
    listener for panel1, capture phase, target =
    Evphases0.panel1.UIComponent8.UITextField10, currentTarget =
    Evphases0.panel1
    listener for panel1, bubbling phase, target =
    Evphases0.panel1.UIComponent8.UITextField10, currentTarget =
    Evphases0.panel1
    listener for application, bubbling phase, target =
    Evphases0.panel1.UIComponent8.UITextField10, currentTarget =
    Evphases0
    I expected the target to be Evphases0.panel1, not
    Evphases0.panel1.UIComponent8.UITextField10.
    What's the reason for this unexpected target?

    Thank You for the tip to run in safe mode.
    The redirects stopped, and after disabling all plugins when not in safe mode the redirection stopped.
    Upon further investigation, I deleted all plugins, but at that point the redirection continued. At that point a "Flash Plugin" was found under the Extensions tab. Once that was removed the redirection stopped completely.
    Afterwards a clean instal of Flash, Java, and Silverlight was performed with no redirection currently.

  • Events after error message

    Hello experts,
    I want to initialize a checkbox in hierarchical list after error.
    I've got some problems to understand the event-flow.
    The facts:
    I'm displaying a hierarchical list and, on user-command, i check some values.
    If there is an error, i send a message.
    When the user get the message and then click OK, I want to initialize the checkbox field of my hierarchical list.
    I don't know where i have to place my abap code to do that: at user-command, or is there an event i ignore to do that.
    Thank you for any help,
    Christine

    Hi,
    I've solved my problem my using the BAPI POPUP_TO_CONFIRM which display the error message.
    So i can test the answer, and decide to refresh the whole display of the list.
    Regards,
    Christine.

Maybe you are looking for

  • Why do more empty, localstore.rdf and perf.js files appear in my profile everytime I open and close Firefox?

    I have hundreds of empty localstore{xxx}.rdf and perf{xxx}.js files in my profile folder. Where {xxx} denotes a number. New, higher numbered files appear every time I open/close firefox. There ate two pref files (perf.js and perf1.js) which are not e

  • IMac 27" (2009) ATI 4850 driver in Bootcamp 3.1 outdated?

    Hello, I just updated my Windows 7 64 bit installation on my iMac 27" i7. I was not happy to see though that the ATI drivers are old (9.1). I used modified 9.12 drivers before which worked much better, just didn't show 32bit colors, instead only 16bi

  • Javascript alert stops button firing in IE

    This isn't really an Apex issue, it seems to be the way IE works - but I wonder if anyone has a work-around? 1) I have an item with an onchange event that displays an alert - e.g. onchange="alert('Hello');" 2) I have a button SUBMIT that submits the

  • IPad and iTunes taking forever to sync out of the blue

    My iPad synced in 'normal' time, just under 10 minutes, yesterday. Today, the syncing is taking forever! Appears that a completely new backup was done, and now it barely moves. I did not download anything to iPad between these syncs. I used it, charg

  • Communicating w. running (non-Java) process from Java

    I'd like to be able write a Java program that can run an instance of a text editor, say NotePad or TextPad, with some text file open (I know how to do this via the Runtime class' exec method), but then, at a later point, open some other text file in