Last active
April 23, 2018 06:35
-
-
Save marchbold/08c96240c4d30c80fb99 to your computer and use it in GitHub Desktop.
distriqt.extension.adverts.eventhandling.as
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Adverts.isSupported) | |
{ | |
Adverts.service.initialisePlatform( AdvertPlatform.PLATFORM_ADMOB ); | |
var adView:AdView = Adverts.service.createAdView(); | |
adView.setAdUnitId( AD_UNIT_ID ); | |
adView.setAdSize( AdSize.SMART_BANNER ); | |
// Add advert event listeners | |
adView.addEventListener( AdViewEvent.LOADED, loadedHandler ); | |
adView.addEventListener( AdViewEvent.ERROR, errorHandler ); | |
adView.load( new AdRequestBuilder().build() ); | |
adView.show(); | |
} | |
function loadedHandler( event:AdViewEvent ):void | |
{ | |
trace( "adverts_receivedAdHandler" ); | |
} | |
function errorHandler( event:AdViewEvent ):void | |
{ | |
trace( "adverts_errorHandler:: " + event.details.message ); | |
// If you wish you can force a reload attempt here | |
// by setting a delayed call to adView.load | |
} | |
// com.distriqt.Adverts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment