Skip to main content
Aug 3, 2013 10:50 AM UTC
Answered

Getting started with iAd extension

Hi,

I recently purchased the iAd extension for ios package from milkman and am having trouble implementing it.

I have followed the Getting Started document but am having no joy. I have attached some screenshots to show how it is set up and the problems.

1) API library included

2) Code used in first frame of test app file

3) Errors received when publishing

4) Errors received when private is taken out

5) When I turn strict mode off and publish, I just get a blank white screen when viewing the app on my iPhone.

Please help!

Thanks!

This topic is closed to new replies. Start a new post to keep the conversation going.
Mark.fromOP
Mark.fromOPCorrect answer
Inspiring
Aug 7, 2013 12:25 AM UTC

Your problem is right there in the errors. Looks like you are coding on the time line instead of the class. That's fine, but that means get rid of class related things like private function and extends class stuff. That is what your first error is about. When you do that you are getting the second error, here I can see in your code you have set up the listeners for those 2 functions but you do not have the actual function onBannerAdLoaded and onBannerAdFailed. Find those two in the docs or below add them to your code.

function onBannerAdLoaded(e:IAdEvent):void

     {

        trace("banner ad loaded.");

     }

private function onBannerAdFailed(e:IAdErrorEvent):void

    {

        trace("banner ad failed");

    }

The last error is a typo on your part. In line 18 you have a lowercase ad as in Iad it should be IAd, remember flash is very case sensitive. So change it to this.

IAd.iAd.createBannerAd(IAdBannerAlignment.TOP,IAdContentSize.PORTRAIT_AND_LANDSCAPE);

5 replies

Known Participant
Aug 28, 2015 7:55 AM UTC
Known Participant
Jan 26, 2014 3:07 PM UTC
Mark.fromOP
Mark.fromOPCorrect answer
Inspiring
Aug 7, 2013 12:25 AM UTC

Your problem is right there in the errors. Looks like you are coding on the time line instead of the class. That's fine, but that means get rid of class related things like private function and extends class stuff. That is what your first error is about. When you do that you are getting the second error, here I can see in your code you have set up the listeners for those 2 functions but you do not have the actual function onBannerAdLoaded and onBannerAdFailed. Find those two in the docs or below add them to your code.

function onBannerAdLoaded(e:IAdEvent):void

     {

        trace("banner ad loaded.");

     }

private function onBannerAdFailed(e:IAdErrorEvent):void

    {

        trace("banner ad failed");

    }

The last error is a typo on your part. In line 18 you have a lowercase ad as in Iad it should be IAd, remember flash is very case sensitive. So change it to this.

IAd.iAd.createBannerAd(IAdBannerAlignment.TOP,IAdContentSize.PORTRAIT_AND_LANDSCAPE);

Translate
Aug 7, 2013 8:18 AM UTC

Hi Mark, thanks for you answer and helping a tired newbie (ish ) out!

Thanks for taking the time, it really helped, I have it working now.

Just a side note, the Iad instead of IAd was actually in the official 'getting started' guide, not sure how I missed it though... Fresh eyes always help!

Thanks again!

Translate
Mark.fromOP
Inspiring
Aug 7, 2013 8:28 AM UTC

I believe that, I recall when I first instituted iAd in my app I had the same issue and it stumped me for a while.

Have you considered Milkman's Admob extension, I find Admob a better option, although they have much lower eCPMs than iAd they have insane fill rates, right around 90% where iAd is never above 10% in my experience.Also the same code can be used on iOS and Android.

Also I recently discovered, although have not yet used, Tap for Tap, they provide a free Adobe AIR extension, you can consider that, or all 3 and if one fails call another.

https://tapfortap.com/doc/AdobeAir

Mark

Translate