2 Replies Latest reply on May 23, 2006 7:28 AM by I tried

    Loader complete function

    I tried
      I'm attempting to run some a function after the loader.complete event fires. I've added the code as adobe recommends, but to no avail. I'm not seeing the function fire at all. Here is my simple code:

      private function init(){
      var owner = this;
      var listenerObject bject = new Object();

      listenerObject.complete = function(eventObj bject){
      trace("We never do this");
      owner.imageLoaded();
      };
      mcLoader.addEventListener("complete", listenerObject);
      }

      Has anyone else had any trouble with this event? Any tips on how I can test for this event firing?

      Thanks
      Robert
        • 1. Re: Loader complete function
          tonyhigham
          your setup is fine...i assume that this is part of a class definition since you used the private declaration, so it must be a pathing problem. i don't really have much experience setting up my own classes, so maybe someone else can point you in the right direciton, but your event handler is otherwise correctly constructed. try tracing your mcLoader properties in the init function to make sure that path is correct...

          btw, did you know that you can specify a function rather than an object for these event handlers?
          • 2. Re: Loader complete function
            I tried Level 1
            I appreciate your reply. I actually went a different route. Instead of using a loader, I went with a moviecliploader and its events worked out better for me. Also, I tried using a function before I tried using an object, and the compiler didn't like it.