addEventListener and the scope of this

后端 未结 3 648
时光说笑
时光说笑 2021-01-02 04:53

I have a third party flash object which i can manipulate through a javascript API they provided. I am tryind to listen to an event on this object and then fire event inside

3条回答
  •  甜味超标
    2021-01-02 05:28

    This is the typical approach to this problem:-

    (function(self) {
      self.chart.addEventListener('create', function() {self.fireEvent('created');}, false);
    })(this);
    

提交回复
热议问题