Reputation: 31
I tried to use admob ANE from this link:
https://code.google.com/p/flash-air-admob-ane-for-ios-and-android/
Followed the instructions, load up the ane file and put the code :
var admob:Admob=Admob.getInstance();//create a instance
admob.setKeys("a152834c2b8cce6");//set admob appid
admob.showBanner(Admob.BANNER,AdPosition.BOTTOM_CENTER);//show banner with relation position
but it seem that flash cannot load the ane properly. Error :
Scene 1, Layer 'Layer 6', Frame 1, Line 15 1046: Type was not found or was not a compile-time constant: Admob.
Scene 1, Layer 'Layer 6', Frame 1, Line 15 1120: Access of undefined property Admob.
Scene 1, Layer 'Layer 6', Frame 1, Line 17 1120: Access of undefined property Admob.
Scene 1, Layer 'Layer 6', Frame 1, Line 17 1120: Access of undefined property AdPosition.
Im using flash cs6 with air sdk 4.0, am i missing anything?
Upvotes: 1
Views: 1295
Reputation: 31
I did have exactly the same problem with so.cuo.platform.admob.Admob
And i lot of time to make it work.
When i manage to integrate it the app was refused since the library is obsolete.
I then found this other ANE extension which seems a lot more complete:
- https://github.com/lancelot1/ane-admob
This did work at first try also in CS6, and the app did pass the approval.
The ad in the app are now working flawless!
Strongly suggested if you still have issue, or if you wish to switch on a more advance extension.
Upvotes: 0
Reputation: 11
I saw the doc https://github.com/lilili87222/admob-for-flash ,find you have a error in the code.
var admob:Admob=Admob.getInstance();
admob.setKeys("a152834c2b8cce6");
admob.showBanner(Admob.BANNER,AdmobPosition.BOTTOM_CENTER);
but your code is
admob.showBanner(Admob.BANNER,AdPosition.BOTTOM_CENTER);//show banner with relation position
you need change AdPosition to AdmobPosition
Upvotes: 1
Reputation: 23
make sure you import the ane
import so.cuo.platform.admob.Admob;
import so.cuo.platform.admob.AdmobPosition;
also link the ane in cs6 by clicking actionscript 3 settings and choose the .ane file
Upvotes: 1