LoginSignup
1
0

More than 5 years have passed since last update.

LimeJSにおけるイベントのstopPropagation

Last updated at Posted at 2012-03-16

LimeJSのオブジェクトに対してgoog.events.listen(obj, 'type', fn, false this);のようにした場合、fnの引数に渡されるイベントはlime.events.Eventで、stopPropagationも実装されているのですが、
内部的にgoog.eventsの処理でカスタムイベントとして処理されているのでうまく働かないようです。
stopPropagationするにはlime.events.Event.eventを使うとうまくいくようです。

exLimeStopPropagation.js
var sprite = new lime.Sprite();
      sprite.setSize(...)...
var fn = function(e) {
  e.event.stopPropagation();
};
goog.events.listen(sprite, 'mousedown', fn, false, this);
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0