1 2 3 Previous Next 104 Replies Latest reply on May 15, 2013 9:36 AM by undereyes Go to original post
      • 40. Re: Admob - Google Ads?

        I think I have it:

        //My code:

        function StageWebViewExample()
            webView.stage = this.stage;
            //webView.viewPort = new Rectangle(0,0,stage.stageWidth,stage.stageHeight);
            webView.viewPort = new Rectangle(0,395,800,85);
            webView.loadURL( "http://www.bluetoastmedia.com/admob/charlies_rocket.html" );
        function getUpdate(event:LocationChangeEvent):void
            if (webView.location != "http://www.myadpage.html")
                //handle resize here:
                webView.viewPort = new Rectangle(0,0,800,480);



        //so far it works. It resizes the viewport if the ad is clicked and loads a full screen of the url.

        • 41. Re: Admob - Google Ads?
          CowboyBlue Level 1

          one minor issue.

          I cannot open the market from an ad. I can open urls but not the market. Hmmmm.

          • 42. Re: Admob - Google Ads?
            CowboyBlue Level 1

            And here is the answer to that one. Forget resizing the viewport. This launches the native browser


            function getUpdate(event:LocationChangeEvent):void
                if (webView.location != "my_ad_URLpage")
                    //handle resize here:
                    //webView.viewPort = new Rectangle(0,0,800,480);
                    navigateToURL( new URLRequest( event.location ) );





            • 43. Re: Admob - Google Ads?
              Joe ... Ward Level 4

              Note that the locationChange event can't be prevented -- only the locationChanging event. And for some reason, locationChanging events are not dispatched when you click on an ad.


              I suspect your code works because navigating to a market: URL doesn't work in the StageWebView, it only works with navigateToURL(). If you clicked on an ad with a http: destination, the StageWebView would navigate. The workaround I came up with is to launch the system browser in response to the locationChange() event (as you do), but since I can't prevent the default, I just reload my ad page. (This is demonstrated in the code I posted earlier).

              • 44. Re: Admob - Google Ads?

                Hey guys,

                I'm trying to setup an admob account, but couldn't get any ads to display. Do I need a wap site for this, or can I use my regular server?

                I copied the code posted here by someone, and when I tried it in my browser, all I got was just an empty page...

                • 45. Re: Admob - Google Ads?
                  Tatanium Level 1

                  Does Adobe even track these forums?


                  Adobe needs to throw some weight over at Admob and get them to release an official API for A4A (Air 4 Android).

                  • 46. Re: Admob - Google Ads?

                    I agree. I love as3. It is a beautiful language. But I keep looking into Unity/Java(Script) etc... just because of the Ad api's.

                    To me a perfect Ad integration would be the killer-flash apl. Maybe it's not Adobe's core business; but they even have the

                    power to become the default ad-broker for flash apps.


                    just my 2cts

                    • 47. Re: Admob - Google Ads?



                      make sure there's ads available for your "location", I only got a banner once from my location (sweden)


                      I do more often get more ads when rendering my page @ http://ipinfo.info/netrenderer/index.php (germany)

                      • 48. Re: Admob - Google Ads?
                        NanoMInd Level 1

                        This looks nice:




                        According to a post on the forum there will be support for the PlayBook soon; so this would work with AIR then.

                        But if Adobe could copy this service that would be even better

                        • 49. Re: Admob - Google Ads?

                          Ive got ads loading into air apps. You can click on them but it throws a sandbox error. Maybe some one else  can help. Code is real simple and derived from the flash lite sdk.


                          Remember to update your site ID. Below are URL's to regular and test ads. The only differences is the additions of 'm=true' to enable test mode. Download the flash lite sdk if you would like to decode the URL or use other options not included here.


                          ** Ad URL **

                          var remoteSwfUrl:String =
                                              "http://r.admob.com/ad_source.php?f=swf&client_sdk=1&s=<SITE_ID>&u=Adobe%20Device%20Central&screen_width=480&screen_height=816&so=normalp&v=20100322-Flash Lite-23e06b5ca61845dc&pub_data[fl_gif]=0&pub_data[fl_jpg]=0&pub_data[fl_png]=1&pub_data[fl ash_lite_version]=FlashLiteVersion";


                          ** Test Ad URL **

                          var TestUrl:String =
                                              "http://r.admob.com/ad_source.php?f=swf&client_sdk=1&s=<SITE_ID>&m=true&u=Adobe%20Device%20Central&screen_width=480&screen_height=816&so=normalp&v=20100322-Flash Lite-23e06b5ca61845dc&pub_data[fl_gif]=0&pub_data[fl_jpg]=0&pub_data[fl_png]=1&pub_data[fl ash_lite_version]=FlashLiteVersion";





                          <mx:SWFLoader id="Ad" />


                          It appears that one of the biggest problems is the loaded SWF(Ad) is an older version, Avm movie 1 (or something). If this were updated to an actions scrip 3 - avm move 2, then retrieving variables from the swf (including the link url) would be possible/easier.

                          • 50. Re: Admob - Google Ads?
                            as4more Level 1

                            I'm using the latest BETA of Adobe Flash Builder 4.5 (Burrito) and Hero 4.5.


                            My limited research led me to believe that AdWhirl is a spin off of AdMob and the best option availible (most desirable MobileApplication ad solution).

                            Unfortunately at this time libraries only exist for iPhone and Android (not AS3).


                            I started a repository version of the free source code for AS3 but ramming it the Android Java version through a Java to AS3 converter.

                            It lacks certain classes that would need porting.


                            I've left it open ended and kind of requested a call to action there a month or so ago and thought I would get to it at the end when I need it if there isn't a solution. That time will soon be apon me and others.


                            I think maybe there is a simpler (but likely not better) solution here to explore first. Still I wanted to put my thoughts out there in hopes the community can get on bored with this AdWhirl solution (still needing further porting).

                            • 51. Re: Admob - Google Ads?
                              as4more Level 1

                              Oh wait up what's this...???


                              Oh RM=RichMedia it's not a distribution platform.. I don't think. Just using Flash for Ads of which is another content form the ad distributors need to incorporate... or die (okay apparently HTML 5 too but it's more open sourced via java, so I'm not interested in using that.)

                              It's suggested through a description section called "analytics" but one can already do that within flash on the conventional Google Analytics (which is totally off topic here). And more important from the distribution side of things for tracking payout (which is ultimately the point of my bothering here).


                              What what's this?...


                              still a NO?, F! Well I'm sure somethings on their minds to actually provide a distribution network that pays out App developers. Then again maybe not.

                              Back to AdWhirl porting I guess.

                              • 52. Re: Admob - Google Ads?

                                Has anyone tried this?



                                • 53. Re: Admob - Google Ads?

                                  Yes, this example is great, I now have two applications in the market both with Admob.

                                  • 54. Re: Admob - Google Ads?

                                    Is anyone else having difficulty getting the ads served?  The page loads, admob says I

                                    requested an ad, but they're not filling.  Thoughts?

                                    • 55. Re: Admob - Google Ads?

                                      1) Are you viewing it on an actual mobile device, or just on your computer? Seems you need to actually be viewing the requested page or app on a mobile device for the ads to show.

                                      2) In the AdMob settings, does it show as "Active" (I think that's what it should say, I forget exactly) for that "Page/App" that you set up?

                                      3) Make sure you have the correct code in your page (JavaScript, if I remember correctly) and with the correct ID given by AdMob. Make sure test mode is false also, though you should see something either way, if it's hooked up correctly.

                                      4) If you request the same page over and over, I think it stops your IP from seeing ads on that page (or it replaces them with only House Ads, if you have any set up).

                                      • 56. Re: Admob - Google Ads?

                                        So... finally, fully mastered.  No scroll bars. All options. Location tracking. Everything.

                                        Got it all working in both AdMob and Smaato.  And NEITHER require you host your own server or know PHP.




                                        Exciting times, sorry it took so long.  You can contact me at adhelp@carrsolutions.com if you want info/code on how to enable all advanced features.  Or, if you don't feel like getting into the code yourself, I can set up all the AdMob accounts needed and do the coding/customization for you at a reasonable price.



                                        • 57. Re: Admob - Google Ads?

                                          Bump. Does anyone have any an ad network runing in their app? Carr's admob demo stopped working due to click fraud?? How in the world is a small developer going to satisfy the need for a million impressions per month? That's insane.


                                          I'm really regretting learning flash.

                                          • 58. Re: Admob - Google Ads?
                                            boat5 Level 2

                                            it still works for me. i see both admob and smato ads in his app. Sometimes admob does not have an ad to serve to you, is it possible this is what your seeing? Or did you hear there was a click fraud issue?

                                            • 59. Re: Admob - Google Ads?
                                              12345abcdefghi Level 1

                                              Thanks for replying boat5!


                                              I only see the smaato ad and the admob ad is just a light grey rectangle on my android device. Would it matter if my device happens to be a samsung galaxy tab?


                                              This guy has a long article on how he got his working here:




                                              But then in one of his comments he says his account got suspended for click fraud.


                                              But you say carr's app is working ok on your device? Have you loaded it recently and looked at it?





                                              • 60. Re: Admob - Google Ads?
                                                boat5 Level 2

                                                Yes I just tried it today when posting that reply. It works in carrs app both admob and smatto. I also have it working with my own app using StageWebView with the same technique described by Terry Patton (also described by adobe here). It should work on any android device (i'm not sure about iOS).

                                                It does work and it does credit the impressions...But! my app is not public yet, so my (and perhaps carrs) apps are not getting near the traffic that terrys apps would get on a daily basis. If you get high traffic i have no idea if admob will cut your account or not... so far they don't seem to mind my $0.85 account


                                                The admob mode we are using is 'smartphone/web' ads for mobile web sites. StageWebView is a browser window to a mobile website containing your ad. I personaly don't understand why this would be viewed as fraud, especially "click fraud" but again i have no real experience with admob or smatto. my account $ level is a joke.


                                                Another issue is that under the 'smartphone web' in admob, much of the time no ads show up. I think this has to do with the amount of advertisers using the  smartphone web option, your location, the admob account, and your network connection. For example i might get no ads under my WIFI connection, but i do get ads if i switch to the phone providers Internet (3g connection in my case). Or i might get the same ad for 5 days in a row under 3g, then switch to my local network and immediately get different types of ads.


                                                Sorry i just realized i can't really answer your question. Mine works, Carrs works, but if you get any real use out of it will admob cut you off for some reason? Not sure...

                                                • 61. Re: Admob - Google Ads?
                                                  12345abcdefghi Level 1

                                                  Thanks again for your info. I wrote to carr. I hope he writes back.

                                                  • 62. Re: Admob - Google Ads?
                                                    mola2alex Level 1

                                                    Adobe, this is a must if you want AS3 to be successful in mobile, especially android.

                                                    • 63. Re: Admob - Google Ads?

                                                      Did carr write you back?  I am looking for someone to do this part of the coding for me.  even if for a fee.


                                                      also, i did check carr's app, and I also can not see the Admob ad.  But I do see the smaato ad.

                                                      • 64. Re: Admob - Google Ads?
                                                        12345abcdefghi Level 1

                                                        Yes I was able to contact him. I have not opted for his service. I am currently working with admedia.com for an as3 solution. So far nothing but I will post a thread if they are able to pull it off. Looks like a good company. They respond very quickly to inquiries.

                                                        • 65. Re: Admob - Google Ads?
                                                          vgjhav Level 1

                                                          After a lot of trouble (account canned on ADMOB ) and research, I have gotten Ads to work in all my Android Apps. This will work on a lot of AD networks, but most will ban you click fraud. Only one network allows this method and they provide support for it too.


                                                          I have over 100 games apps. with this method implemented and working. Here is a link to one of them for you to see how it will look in game. I am using multiple ads in this to force the user to click and make me some money: https://market.android.com/details?id=air.GraffitiCityMarketFree&feature=search_result


                                                          Does LeadBolt offer HTML integration for banner ads?

                                                          LeadBolt does allow banner ads to be integrated into your app using HTML, rather than using our SDK. To create a HTML banner ad after adding an app to the LeadBolt portal, simply click “Add Ad” and select “App Banner (HTML)” from the drop down box. The HTML snippet can then be added directly into your app’s HTML framework.

                                                          So far my eCPM is $6.15


                                                          I have created this guide to show my appreciation:


                                                          Publisher Code:


                                                          STEP I:

                                                          Get an Account: http://leadboltapps.com/web/publishers/signup.php?ref=10022842

                                                          STEP II:

                                                          Click on the “APPS” tab and “Create New APP” to create an AD. Remember to change content unlocker to HTML Banner. While in the process.

                                                          STEP III:

                                                          Get the HTML AD Code and keep it safe. That is all we need from the site. How simple was that?


                                                          AD HTML FILE:


                                                          Create an HTML File and Load it to your site. Remember to replace your HTML Code from above step with where I have put: ****ENTER HTML AD CODE HERE****


                                                          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

                                                          <html xmlns="http://www.w3.org/1999/xhtml">


                                                          <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

                                                          <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>

                                                          <title>Untitled Document</title>

                                                          <style type="text/css">

                                                          body,td,th {

                                                               color: #FFF;


                                                          body {

                                                               background-color: #000;

                                                               margin-left: 0px;

                                                               margin-top: 0px;

                                                               margin-right: 0px;

                                                               margin-bottom: 0px;

                                                               text-align: center;

                                                               position: relative;







                                                          ****ENTER HTML AD CODE HERE****




                                                          Action Script Code:


                                                          STEP I:

                                                          Credit: I found this on another site and would like to give credit to the author of pixelpaton.com

                                                          The only change you need to make is to enter your website html url where you have placed the AD HTML FILE in the space where I have put : "****ENTER COMPLETE HTML URL HERE****". Where ever you want the AD, place the following code:


                                                          // imports

                                                          import flash.events.Event;

                                                          import flash.events.LocationChangeEvent;

                                                          import flash.geom.Rectangle;

                                                          import flash.media.StageWebView;

                                                          import flash.net.navigateToURL;

                                                          import flash.net.URLRequest;

                                                          import flash.events.MouseEvent;


                                                          // setup variables

                                                          var _stageWebView:StageWebView;

                                                          var myAdvertURL:String = "****ENTER COMPLETE HTML URL HERE****";





                                                                          // 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, 100);

                                                                                          // add a listener for when the content of the StageWebView changes


                                                                                          // start loading the URL;



                                                                          // show the ad by setting it's stage property;

                                                                          _stageWebView.stage = stage;


                                                          function toggleAd(event:MouseEvent):void {

                                                                          trace("toggling advert",_stageWebView);

                                                                          // check that StageWebView instance exists

                                                                          if (_stageWebView) {


                                                                                          if (_stageWebView.stage == null) {

                                                                                                          //show the ad by setting the stage parameter

                                                                                                          _stageWebView.stage = stage;

                                                                                          } else {

                                                                                                          // hide the ad by nulling the stage parameter

                                                                                                          _stageWebView.stage = null;


                                                                          } else {

                                                                                          // ad StageWebView doesn't exist - show create it





                                                          function destroyAd(event:MouseEvent):void {

                                                                          // check that the instace of StageWebView exists

                                                                          if (_stageWebView) {

                                                                                          trace("removing advert");

                                                                                          // destroys the ad

                                                                                          _stageWebView.stage = null;

                                                                                          _stageWebView = null;




                                                          function onLocationChange(event:LocationChangeEvent):void {

                                                                          // check that it's not our ad URL loading

                                                                          if (_stageWebView.location != myAdvertURL) {

                                                                                          // destroy the ad as the user has kindly clicked on my ad


                                                                                          // Launch a normal browser window with the captured  URL;

                                                                                          navigateToURL( new URLRequest( event.location ) );



                                                          // setup button listeners



                                                          Hope this works and helps you. If you have questions, let me know. Enjoy.

                                                          • 66. Re: Admob - Google Ads?
                                                            12345abcdefghi Level 1

                                                            Wow thanks for sharing. I will look into your solution!

                                                            • 67. Re: Admob - Google Ads?
                                                              mola2alex Level 1

                                                              Thanks for sharing.  I will check it out.

                                                              • 68. Re: Admob - Google Ads?
                                                                mola2alex Level 1

                                                                Couple quick questions?  I am waiting for registration to go through.


                                                                1) Are there standard ad sizes?  I noticed the one in your app is quite large but the space I have in my apps are more aligned with the admob size.  Also, how do these look when used on tablet devices?  With the current admob way, the ad only takes up a small amount of the scaled webview component but full webview on the smaller screen resolutions.  If I try to make the size of webview smaller on tablets (relative pizel), it will not display ads.  Wondering if you have any experience there.


                                                                2) On your app, I only get ads for the ad provider (leadbolt) to advertize with them.  Do they have enough ads to fill requests? 


                                                                3) Did you get your admob account suspended because of how you implemented your ads?  My account is working fine (but not generating lots of $) and I contacted admob about suspension regarding this method and the response was:


                                                                Hello Matthew,

                                                                Thank you for your inquiry.  While this method may not currently be supported, which means it may not give you the results you are expecting, you would not be at risk of having your account suspended unless your app is found to be malicious.

                                                                Also, keep in mind as AdMob continues to integrate with the Google platform, you may also consider reviewing the AdSense ToS as standards may be slightly different than the current AdMob standards.

                                                                Best regards,

                                                                AdMob Support

                                                                • 69. Re: Admob - Google Ads?
                                                                  vgjhav Level 1

                                                                  1. With ADmob my ads did not always load in the game. They were there, and

                                                                  you could click it, but couldnt see them. There are standard banner sizes. I

                                                                  use 468x60 and 300x250. It does auto scale in tablets. Not found a fix to



                                                                  2. Which country are you in? If they do not support your country too much,

                                                                  that is the ad you will see. Has good PPC though.


                                                                  3. What i did was kinda dumb. I made two pages and linked all my 100 games

                                                                  to load ads from those two pages. So i made a lot of money and had a lot of

                                                                  clicks. They called that click fraud.


                                                                  Use what works best for you. The only real thing i like about leadbolt is

                                                                  they advertise they support html ads and plan to make their api work with

                                                                  adobe. So i am going to support them.


                                                                  Hope that helps.

                                                                  • 70. Re: Admob - Google Ads?
                                                                    mola2alex Level 1

                                                                    1. Thanks

                                                                    2. Canada but my apps are global so I may experiement with one of them and this way

                                                                    3. All my apps are linked to the same ad page as well.  I don't have 100's of them or a high click rate.  To be honest I am making nothing off of ads but have lots of downloads so I need to explore some options around making money off of this.  Agree, that if they are committed, pay more and have lots of ads that this is a great option.  I don't want to invest time in a banned account.  I wish Adobe would partner and make it simpler to do all this. 

                                                                    • 71. Re: Admob - Google Ads?



                                                                      just a few minutes ago I got admob running on my android game, using a method James Ward found http://www.jamesward.com/2011/05/11/extending-air-for-android/ Flash can talk to the android api via a localhost service and trigger the ad view. Whenever you want it to show or remove

                                                                      I will write a tutorial on my google+ page tomorrow. Its not using the method with a html page and JS, where lots of accounts got cancled due to click fraud.

                                                                      • 72. Re: Admob - Google Ads?
                                                                        vgjhav Level 1

                                                                        That would be awesome buddy... Do share. So you got it working via the

                                                                        android ad and not smartphone?

                                                                        • 73. Re: Admob - Google Ads?
                                                                          vgjhav Level 1

                                                                          JoeCoo7 - I guess it is not tomorrow for you. IST time here, awake and

                                                                          wanted to take a crack at your solution. Do write it, and kindly make it

                                                                          dummy proof for me. Also hoping that your solution is for Flash Pro and not

                                                                          Flash Builder. I had found that solution a while back, just couldnt

                                                                          understand it.


                                                                          Actually if possible, could you make it work smaato? They seem to more easy

                                                                          to integrate and they have some pretty cool ad formats.



                                                                          • 74. Re: Admob - Google Ads?
                                                                            JoeCoo7 Level 1

                                                                            I have posted the tutorial on my blog, google+ does not have any codeformatting I guess .

                                                                            If you got any questions, please use the comments on my blog.


                                                                            Its actually quite some work to set everything up and you need FlashBuilder because you have to compile an android project. You could also use the normal eclipse if you haven't got a flash builder license. I haven't written a complete tutorial, because James Ward did already write a good one for some vital steps. So you have to follow his steps first and then mine, as stated in my blog post.


                                                                            The good thing is, if you have setup this, you can do really cool stuff, not only use admob, but any other ad provider which offers a android API and add splashscreens or  make us of any native APIs which are not supported by air yet.


                                                                            I might look into iOS soon, but I guess that is probably even more complicated.


                                                                            @Vik: to be honest, its still a little complicated, even with the tutorial steps. I haven't got the time to make everything dummy proof, but I can surley answer some questions if you are stuck.

                                                                            • 75. Re: Admob - Google Ads?
                                                                              vgjhav Level 1

                                                                              Thanks a ton. Will give it a go tonight or Sunday. Thanks again.

                                                                              • 76. Re: Admob - Google Ads?
                                                                                mola2alex Level 1

                                                                                Is it possible to put the HTML code into AS3 to be read by the webview or attach the HTML file and referencing it when you publish the app or does it need to be hosted somewhere on the web for this to work?

                                                                                • 77. Re: Admob - Google Ads?
                                                                                  vgjhav Level 1

                                                                                  It needs to be hosted. But there are a lot ofgood free hosting companies.

                                                                                  Use any one and you will be good.


                                                                                  The other method never worked for me. So i am still hosting and using that


                                                                                  • 78. Re: Admob - Google Ads?
                                                                                    mola2alex Level 1

                                                                                    I added leadbolt to a few apps, I will see what happens.  I noticed that with admob, when the air app was blown up to tablet size, the ad only took up a portion of the webview leaving a huge blank space (webview scaled but ad didn't).  When I tried to fit in the admob ad by scaling the webview down for tablets, it would not show at all, seems to need the dimensions of the webview to match but then doesn't scale the ad.  With leadbolt, I was able to modify the webview dimensions and remove the wasted space and ad showed as I wanted.  Leadbolt will be what I use for tablets going forward as well as testing a few other apps.  Anyone interested in seeing it, download it at the below link.  Install it on tablet and phone and compare.



                                                                                    • 79. Re: Admob - Google Ads?
                                                                                      vgjhav Level 1

                                                                                      Can you share the code too? I have put leadbolt content unlocking on my site

                                                                                      too, getting good conversions. Cant wait for their API to support native

                                                                                      adobe air for android.