javascripteventsdom-eventsfirebreath

Firing events in FireBreath


I am writing a wrapper class for an activex control using a FireBreath plugin.

In the FireBreath activex wrapper example linked to from the documentation of FireBreath the author of the project uses FireEvent to asynchronously fire the event from the activex container class.

But the documentation of FireBreath now has a note under the method FireEvent which says:

"Note: Firing events in this manner is deprecated as of FireBreath 1.5.0"

And also in the example the events are not registered in the root JSAPI object using this format:

FB_JSAPI_EVENT()

So is this the right way of doing it? Or is it possible to call the events from the container class using the

fire_event() 

method?


Solution

  • Both work the same way, the reason that calling FireEvent directly is deprecated is just that it's easier to make mistakes with the parameters you pass in.

    You can use either method, but I recommend that you use FB_JSAPI_EVENT simply to keep things more clear.