admob 广告在 Android Air 应用程序中不起作用
这是我在 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>
任何人都可以指导我哪里出了问题吗?
This is the code i have used in 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;
}
This is the html code in admob.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>
Can any one please guide me where have i gone wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您好,我认为这段代码可能有效,
只需将 Google.co.uk 替换为您的网址即可。
Hi I think this code might work,
Just replace Google.co.uk with your URL.