MoPub-ANE is a native extension to use the MoPub advertising platform on iOS and Android. The extension allows the developer to displaying banner adverts and interstitial adverts using a simple API. The banner loading process is asynchronous and can be monitored using events.

In order to display a banner, the application must load it first. When the loading is complete, an event is fired and the banner can be displayed. It’s possible to programatically close the ad at any time.


var banner : MoPubBanner = new MoPubBanner( yourAdUnitId, MoPubSize.banner );
banner.x = ( stage.fullScreenWidth - banner.width ) / 2;
banner.y = 0;
banner.addEventListener( MoPubEvent.LOADED, bannerReady );
banner.addEventListener( MoPubEvent.LOAD_FAILED, bannerFailed );

private function bannerReady( event : MoPubEvent ) : void {;
private function bannerFailed( event : MoPubEvent ) : void {
    banner = null;
Air Native Extension, Android, iOS . URL.