4 Replies Latest reply: Feb 8, 2013 7:45 AM by _WORMSS_ RSS

    Wildcard event type

    iamfuric Community Member

      Hello  all

      Is there such thing as wildcard event type ?

      I need event listener for EACH AND EVERY event in the application:

       

      application.addEventListener("*",myHandler)

       

      Thanks

        • 1. Re: Wildcard event type
          meshgraphics Community Member

          No.

           

          If it was an ActionScript project you would have to import the class and reference it somewhere in the project for the class to be compiled in  -- which adds to swf file size.

           

          In Flex, by referencing the event in a tag  -- that is probably the reference to compile it in.

           

          <Button click="myClicker()" />

           

          implied

          import flash.events.MouseEvent.CLICK;

          • 2. Re: Wildcard event type
            _WORMSS_

            I am currently looking into changing how EventDispatcher works using prototyping so when it dispatches an event, it will also dispatch the same event with the "*" type too,

            • 3. Re: Wildcard event type
              pauland Community Member

              I need event listener for EACH AND EVERY event in the application

               

              That sounds like a performance nightmare. Why do you need such a facility?

              • 4. Re: Wildcard event type
                _WORMSS_ Community Member

                Debugging undocumented components. Dont worry, I was not planning this for a live product. But it would be extremely useful to either A, lsiten for ALL events with 1 command such as _someObj.addEventListener("*", debugEventHandler); or as part of EventDispatcher().dispatchEvent(blarblar) have it trace/log out automatically, for EVERY EVENT.. EVER. Yes, an eventlog may get very big very fast, I would prob end up putting in a filter function such as EnterFrame but It would be great to just have the option for those bugs that are deep in either Flash's Own code (yes, they exist) or 3rd party components.