[ASK] Contruct 2 plugin, how to integrate js callback and muted audio

0 favourites
  • 3 posts
From the Asset Store
Antisuspend Plugin for Construct 3 prevents the runtime from getting suspended.
  • This is the script that i want to integrate with Construct 2

    ysdk.adv.showFullscreenAdv({
     callbacks: {
     onClose: function() {
     // some action after close
     },
     onError: function(error) {
     // some action on error
     }
     }
    });

    So, i want to create condition for onClose and onError callback, using my custom plugin, can someone help me to integrate this?

    And how to mute all audio using script?

    I try implement this, but it's not working with Construct 2 w3schools.com/tags/av_prop_muted.asp

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • doesn't it work like this?

    ysdk.adv.showFullscreenAdv({
    	var self = this;
    	callbacks: {
    		onClose: function() {
    			self.runtime.trigger(cr.plugins_.yourpluginname.prototype.cnds.Onclose,self)
    		},
    		onError: function(error) {
    			self.runtime.trigger(cr.plugins_.yourpluginname.prototype.cnds.onError,self)
    		}
    	}
    });
    
  • doesn't it work like this?

    > ysdk.adv.showFullscreenAdv({
    	var self = this;
    	callbacks: {
    		onClose: function() {
    			self.runtime.trigger(cr.plugins_.yourpluginname.prototype.cnds.Onclose,self)
    		},
    		onError: function(error) {
    			self.runtime.trigger(cr.plugins_.yourpluginname.prototype.cnds.onError,self)
    		}
    	}
    });
    

    Thanks for your reply, i will try it

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)