Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LimeJS Custom Sprite Swallowing events

I made a custom Lime JS sprite class by doing:

test.obj = function() {
  lime.Sprite.call(this);
  .
  .
  this.label = new lime.Label(). ...;
  this.appendChild(this.label);
}
goog.inherits(test.obj, lime.Sprite);

I'm unable to get the label click to bubble up to the root program; it always swallows the events. Is there something special you have to do to get a click on the label to bubble up to my root event handler, which is:

goog.events.listen(objinstance, ["click", "touchstart"], function() { .. });
like image 851
Brian Mains Avatar asked Jul 28 '12 17:07

Brian Mains


1 Answers

Are you stopping any propagation? It is quite strange for it to happen otherwise. Look into the listener function which should pass down a goog.events.BrowserEvent object as a parameter and see if they are automatically stopping some propagations from inside the library's source.

like image 87
flavian Avatar answered Oct 22 '22 22:10

flavian