如何通过ActionScript在Flash CC展示AdMob的广告(iOS和Android) [英] How to show AdMob ads (iOs and Android) through Actionscript in Flash CC

查看:192
本文介绍了如何通过ActionScript在Flash CC展示AdMob的广告(iOS和Android)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创造的ActionScript 3和Flash CC一个Flash游戏。我打算公布游戏的iOS和Android。

I am creating a flash game in Actionscript 3 and Flash CC. I intend to publish the game for iOs and Android.

我要寻找一种方式来显示AdMob的广告在Actionscript中。

I am looking for a way to show AdMob ads in Actionscript.

到目前为止,我已经做了这些措施,但没有广告出现在屏幕上的任何地方:

So far I have done those steps but no ads appear anywhere on screen:

    从的在我已经下载admob_all_in_one6.6.7.ane =HTTPS://$c$c.google.com/p/flash-air-admob-ane-for-ios-and-android/相对=nofollow的这里>。
  1. 我增加了姊到我的构建路径中。
  2. 我用当比赛开始低于code,之前什么都:

  1. I have downloaded admob_all_in_one6.6.7.ane from here.
  2. I added the ane to my build path.
  3. I use the code below when the game is starting, before anything else:

import so.cuo.platform.admob.Admob;
import so.cuo.platform.admob.AdmobPosition;
import so.cuo.platform.admob.AdmobEvent;
import so.cuo.platform.admob.AdmobSize;

var admob:Admob= Admob.getInstance();
if(admob.supportDevice){
    admob.setKeys("9141023615", "6222882810");//changed my keys with random ones
    admob.addEventListener(AdmobEvent.onInterstitialReceive,onAdReceived);
    admob.addEventListener(AdmobEvent.onBannerReceive,onAdReceived);
    admob.cacheInterstitial();
    admob.enableTrace=true;
}

function onAdReceived(event:AdmobEvent):void
{
    if(event.type==AdmobEvent.onBannerReceive){
        admob.showBanner(Admob.BANNER,AdmobPosition.TOP_CENTER);
    }
    if(event.type==AdmobEvent.onInterstitialReceive){
        admob.showInterstitial();
    }
}

我已经试过这两个旗帜,插播式广告和没有他们展现出来。我下载我的iPad上的应用程序,并检查它通过在屏幕上显示一个动态文本字段通过了如果(admob.supportDevice)的阶段。

I have tried both banner and interstitial ads and none of them show up. I downloaded the app on my iPad and checked that it passes the if(admob.supportDevice) stage by showing a dynamic text field on screen.

我的问题是:

  1. 我不太知道什么是钥匙是。到目前为止,我复制后 / 部分为每个应用程序( CA-APP-酒馆XXXXXXXXXXXXXXXX / XXXXXXXXXX )。
  2. 如果我在1所做的是正确的,你有什么想法,为什么没有广告显示出来?
  1. I am not quite sure what the "keys" are. So far I copied the part after / for each application (ca-app-pub-XXXXXXXXXXXXXXXX/XXXXXXXXXX).
  2. If what I did in 1. is correct, do you have any idea why no ads show up?

我还没有使用AdMob的任何其他语言,所以我不是太有经验了吧。

I have not used AdMob in any other language so I am not too experienced with it.

推荐答案

我也有同样的问题,so.cuo.platform.admob.Admob

和我浪费了很多时间,使其工作。

And i waste a lot of time to make it work.

当我设法将它集成的应用程序被拒绝,因为该库已经过时了。

When i manage to integrate it the app was refused since the library is obsolete.

然后我发现这个其他ANE扩展,它似乎多了很多完整的:
- https://github.com/lancelot1/ane-admob

I then found this other ANE extension which seems a lot more complete:
- https://github.com/lancelot1/ane-admob

这起初的工作还尝试在Flash CC,并且应用程序都通过了审批。

This did work at first try also in Flash CC, 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.

这篇关于如何通过ActionScript在Flash CC展示AdMob的广告(iOS和Android)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆