title: binding events to dynamic objects in underscore/backbone
body: <p>I'm trying to figure out how to listen for custom events on objects which have not been prototyped or are not dom objects in underscore.js/backbone.js.</p>
  
  <p>for example:</p>
  
  <pre><code>//this is inside a view object
  play: function(arg)
  {
      this.a  = this.image(this.model.a);
      this.a.bind("ready",start,this);//&lt;--- causes error
      this.b  = this.image(this.model.b);
      this.b.bind("ready",start,this);//&lt;--- causes error
      function start()
      {
          // do some stuff in here
      }
      //some more stuff
  
  },
  image: function(args)
  {
      // load the image, get its data, attach to original model then return it.
      var args    = args;
      var img     = $("&lt;img/&gt;");
      var t       = this;
      img.load(function(){
          t.pasteboard.drawImage(this,0,0);
          args.imageData = t.pasteboard.getImageData(0,0,args.width,args.height);
          args.ready = true;
          args.trigger("ready",args);
      }).attr("src",args.src).hide();
      return args;
  },
  </code></pre>
  
  <p>and the model looks roughly like this:</p>
  
  <pre><code>a:{
      src:"/img/a.jpg",
      width:1320,
      height:639,
      x:0,
      y:0,
      opactiy:0,
      scale:[1,1]
  },
  b:{
      src:"/img/b.jpg",
      width:1320,
      height:639,
      x:0,
      y:0,
      opactiy:0,
      scale:[1,1]
  },
  </code></pre>
  
  <p>and the error is:</p>
  
  <pre><code>Uncaught TypeError: Object #&lt;Object&gt; has no method 'bind'
  </code></pre>
  
  <p>of course it makes sense that theres no bind on the object but has anyone got a good solution for this?</p>
  
  <p>Thanks very much
  A</p>