2 Replies Latest reply on Oct 29, 2007 9:07 AM by DJ_James

    addEventListener not working!!!

    DJ_James
      Adding event listeners to a loader, and it won't call the function!! here is the code:

      it doesn't trace anything... anyone know why? is AS3 still buggy? we have weird problems with it!
        • 1. Re: addEventListener not working!!!
          Rothrock Level 5
          I'm not with my Flash CS3 at the moment and I haven't done this enough to just rattle it off the top of my head. but I think there are several things going wrong..

          First I don't think you can just add the listeners directly to the loader. Isn't there some kind of loader progress object that you have to attach them too?

          Next check the documentation. It seems strange that some of the events would come from the Event class and others from the ProgressEvent class. I seem to recall they all come from the same place.

          And in general the answer is "No." no version of actionscript has been particularily buggy. I think there are probably less than one hand's worth of bona fide bugs. Most of the time it is operator error.
          • 2. Re: addEventListener not working!!!
            DJ_James Level 1
            DOH!

            looked at the help, they're passing the contentLoaderInfo into a function... so I just did this:

            splashScreenLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, splashComplete);
            splashScreenLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, splashLoader);
            splashScreenLoader.contentLoaderInfo.addEventListener(Event.INIT, splashLoader);