[英]admob ads not working in android air app
这是我在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>
谁能指导我哪里出问题了?
嗨,我认为这段代码可能有效,
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。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.