【问题标题】:admob ads not working in android air appadmob 广告在 android air 应用程序中不起作用
【发布时间】:2011-12-05 15:32:34
【问题描述】:

这是我在adobe flash中使用的代码

var _stageWebView:StageWebView;
var myAdvertURL:String = "http://www.xxxxx.com/admob/admob.html";
//
createAd()
//
function createAd():void {
    // check that _stageWebView doersn't exist
    if (! _stageWebView) {
        _stageWebView = new StageWebView () ;
        // set the size of the html 'window'
        _stageWebView.viewPort = new Rectangle(0,0,800,50);
        // add a listener for when the content of the StageWebView changes
        //_stageWebView.addEventListener(LocationChangeEvent.LOCATION_CHANGE,onLocationChange);
        // start loading the URL;
        _stageWebView.loadURL(myAdvertURL);
    }
    // show the ad by setting it's stage property;
    _stageWebView.stage = stage;
}

这是admob.html中的html代码

<body>
<script type="text/javascript">
var admob_vars = {
 pubid: 'xxxxxxxxxxxxxx',
 bgcolor: '000000', 
 text: 'ffffff', 
 ama: false,
 test: false
};
</script>
<script type="text/javascript" src="http://mmv.admob.com/static/iphone/iadmob.js"></script>
</body>

谁能指导我哪里出错了?

【问题讨论】:

  • 您是否收到任何错误消息?如果您这样做,请通过编辑将它们添加到您的问题中。

标签: android air adobe admob


【解决方案1】:

您好,我认为这段代码可能有效,

import flash.media.StageWebView;
import flash.geom.Rectangle;
import flash.display.Graphics;

var webAd:StageWebView = new StageWebView();
webAd.viewPort = new Rectangle( 0,0,800,50);
webAd.stage = this.stage;

webAd.loadURL( "http://www.google.co.uk" );

只需将 Google.co.uk 替换为您的网址即可。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多