Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by neogope

Hi all,

at the moment I am a little bit stuck. If I trigger an event in Ejecta with:

[self triggerEvent:@"XYZ" argc:0 argv:NULL];

...

EJ_BIND_EVENT(XYZ)

How do I listen to it in the ImpactJS App? I've tried this

document.addEventListener( "XYZ", function() {
    		ig.game.indicators.x = 'success';
	}, false );

but the callback function never gets executed, even if the event is triggered in the Ejecta code. Do I miss something here with the EventListener? (If I check for the event "touchstart" it is called as soon as I touch the screen .. )

Thanks for your help!

EDIT: Okay, never mind, found it. Had to attach the EventListener to the Object, where I fired the event ..

10 years ago by Rungo73

I am having an issue with this.

I trigger an event in Ejecta from a method called CBDismissed in a subclass of EJBindingEventedBase I've named it EJBindingResponse.

[self triggerEvent:@"dismissed"];

...

EJ_BIND_EVENT(dismissed)


then in my js I have



ig.global.CB = new Ejecta.Response();

...

ig.global.CB.addEventListener("dismissed", function(){

       console.log("ad has been clicked");
}, false );



but it never gets executed. In my Ejecta method I have an NSLog so I know that the method is being called, and I'm not getting an errors.

Can anyone offer any insights? @neogope ?

Thanks in advance!
Page 1 of 1
« first « previous next › last »