Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Contributor
Posts: 14
Registered: ‎05-24-2013
My Device: Blackberry playbook
My Carrier: 7799356358

Showing white Screen in Blackberry playbook

[ Edited ]

Hi,

iam getting white screen at ads place when i load the html page with javascript to display the ads using leadbolt advertising service in blackberry  playbook.

 

I developed the app using adobe AIR.

 

please tell me, can i use the leadbolt html bannar ads to display the ads in Blackberry playbook ?

 

i am showing the code how i used the html to display the ads...

 

 HTML page (Leadbolt html bannar ad):

 

<html lang="en">
<head>
<meta name="viewport" content="width=320; user-scalable=0;"/>
<META HTTP-EQUIV="Refresh" CONTENT="30">
<title>ad</title>
</head>
<body style="margin:0; padding:0;"> 
<script type="text/javascript" src="http://ad.leadbolt.net/show_app_ad.js?section_id=431321333"></script>
</body>
</html>

 

 

MXML page :

 

<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009" 
xmlns:s="library://ns.adobe.com/flex/spark" title="HomeView" viewActivate="init(event)">
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;

import spark.events.ViewNavigatorEvent;
private var htmladURL:String;
private var webView:StageWebView;
public var htmlString:String;
protected function init(e:Event):void {

webView = new StageWebView();
htmladURL = "file://D:/LLB/B_n_M_Flex/LeadboltAds/src/assets/Leadbolt.html";
webView.stage = this.stage; 
webView.viewPort = new Rectangle( 0, 0, 400, 600 ); 
webView.addEventListener(LocationChangeEvent.LOCATION_CHANGE, loadAds); 
webView.loadURL(htmladURL);
}
private function loadAds(e:LocationChangeEvent):void {
if(e.location != htmladURL){
e.preventDefault();
webView.historyBack();
var url:URLRequest = new URLRequest(e.location);
navigateToURL(url);

}
}
]]>
</fx:Script>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>

</s:View>

 

I can see the ads in Flash builder 4.6 emulator but not in the Blackberry playbook and playbook simulator.

 

please help me to get out this problem....

 

Thank you,

Ravi kumar

 

 

Retired
Posts: 427
Registered: ‎02-22-2012
My Device: BlackBerry Z10, BlackBerry Dev Alpha C, BlackBerry PlayBook
My Carrier: Bell

Re: Showing white Screen in Blackberry playbook

Hi,

 

Try using a QNXStageWebview. The API for them can be found here - https://developer.blackberry.com/air/apis/playbook/qnx/media/QNXStageWebView.html

 

If that doesn't work a developer posted this on how to do it for Android but it should be the same for BlackBerry - https://www.youtube.com/watch?v=r92-HpyZb6U

Follow me on Twitter: @dustinmalik
-----------------------------------------------------------------------------------------------------
Keep up to date on BlackBerry development: http://devblog.blackberry.com/