mochi ads and sound on intro screen

fotogeluid

  • Posts: 271
Hi guys,

The first screen of my game has background sound.

If i make a scene with a mochi ad. How can i detect when the ad is gone so i can safely start my background sound.

It isn't allowed to start any sound before the ad is gone. So how i do i detect that the ad is gone?

rob1221

  • *
  • Posts: 9430
The following code that I found in an old thread displays a Mochi ad and then switches the scene when finished.  Note that "2" is a scene ID and you'll need to change that to your next scene's ID (check the console to see it).

Code: [Select]
MochiAd.showInterLevelAd( {clip:FlxG._game, id:GameState.mochiID, res:"640x480", ad_started:function():void{Mouse.show();}, ad_finished:function():void{switchScene(2, createFadeOut(((1000*0.25))), createFadeIn(((1000*0.25)))); Mouse.hide(); }});

fotogeluid

  • Posts: 271
Thank rob, i will give it a try.

If i see the low mochi earnings i start considering launching the game completely ads free.