1 Reply Latest reply on Aug 2, 2006 2:49 PM by fred_sl

    Passing args via listener object

    fred_sl
      I'm wondering if it's bad style to pass arguments in a listener object when loading images with Loader. I have a Canvas class with a method that loads images. It sets an event listener that needs access to the Canvas class data. I tried to get Delegate to work with Loader inside my class but had no luck as I couldn't get addEventListener() to work with Loader.onLoadInit().

      Loader.addListener() technically works, but I need to set the scope. So, as a work -around I tried passing arguments via the listener and it worked, so now I'm curious if this is a bad thing to do.

      Here's what I'm doing (simplified for ease of reading):