Skip to main content
Participant
July 4, 2011
Question

StageWebView not working on IOS?

  • July 4, 2011
  • 7 replies
  • 3359 views

HI,

I have a followed adobes stageWebView example that loads a local html file in a stageWebView, I am using the code to show admob ads...

Well, the project works fine on Android, but on IOS (ipod touch) nothing happens? the stageWebView is just a white rectangle

I am debugging using remote debug, and everything seems fine, the local file url is resolved fine, but after calling the loadurl method nothing happens, I am not getting any events or errors?

I am listening for the following events:

ErrorEvent.ERROR

LocationChangeEvent.LOCATION_CHANGING

LocationChangeEvent.LOCATION_CHANGE

Event.COMPLETE

I have allso tried with loading a online file, but with the same result...

Again, I will mention that the code works perfect on android (HTC Desire).

where do I set the app permissions similar to the android permissions? (I am working in Flash CS 5.5)

Brian
       

This topic has been closed for replies.

7 replies

Colin Holgate
Inspiring
July 4, 2011

What kind of media does admob load? If it's a swf, it won't be able to work in iOS, because webkit doesn't allow plugin content.

fiduzenAuthor
Participant
July 4, 2011

Hi Colin,  The admob loads javascript and regular images, it renders fine in the ipod touchs native browser.  Here is a online version of the html file: http://www.fiduzen.dk/viewad.html  Thanks for your quick reply, Brian

Colin Holgate
Inspiring
July 4, 2011

It seems that the source needs to be at a URL for it to work using loadURL(). Maybe it would work on a device and not in test movie? In any case, another way to go, that does work in test movie, is to use loadString(). Try this with your test html embedded in the app:

import flash.net.URLRequest;

import flash.net.URLLoader;

import flash.events.Event;

var webView:StageWebView = new StageWebView();

webView.stage = this.stage;

webView.viewPort = new Rectangle( 0, 0, stage.stageWidth, stage.stageHeight );

var req:URLRequest = new URLRequest("viewad.html");

var ldr:URLLoader = new URLLoader();

ldr.addEventListener(Event.COMPLETE,loaded);

ldr.load(req);

function loaded(e:Event){

webView.loadString(e.target.data)

}