2 Replies Latest reply on Aug 24, 2007 2:04 PM by clbeech

    AS2 listener in a Class file

    clbeech Level 3
      Hey guys, I've been trying to construct a Class file to consolidate methods for a lot of 'tiles' (MCs) that get dynamiclly added to the running system on call. However many of their functions are regularly fired off (interval) by a listener/broadcaster model, and I can't seem to find any information on building a listener within an .as file? Not in the docs, or forums, google ... nothin'. I've tried several experimental methods to add a listener, but nothing seems to work. Another, facet of the problem is that the broadcaster needs to reside on _level0. Anyone have an thoughts on this?

      Thanks all.
        • 1. Re: AS2 listener in a Class file
          injpix Level 3
          Have you read this article?

          EventDispatcher seems to be what you need. So what exactly is the event that these 'tiles' (MCs) are firing off?
          • 2. AS2 listener in a Class file
            clbeech Level 3
            Yeah I sure did, thought I was on to something there too, but alas, no. The article discribes how to create and use the EventDispatcher Class within an .as file, but not how to construct a Listener to recieve a broadcast.

            The broadcaster is already running at _levelo, broadcasting at a fast interval a movement parameter to all currently existing dynamic 'tiles', which change frequently. (this is a game map, driving ... but way, way more than that, it actually is broadcasting to and moving 9 congruent, 5 layer tile stacks(800x800 ea), with as many as 100 dynamic objects per tile, and two levels of AI) ... ( oh yeah and running hit checks on all of it ... <:P )