Forum Moderators: open

Message Too Old, No Replies

Google Adsense in Flash

         

lsiryan

5:43 pm on May 23, 2006 (gmt 0)

10+ Year Member



Ok, I've gotta site that is 90% flash. The main content is a single swf that the users navigates through to get information. INSIDE that swf I would like to display Google Adsense ads.... which are called via javascript.

So, I, as a total Java newb, was wondering: Can I use fscommand or some such to load a javascript into my swf at runtime, that script being the adsense code, so that ads will display inside my swf?

According to google you can't (actually, according to someone at adsense named PIM who answered my emailed help question), but surely someone here is smarter than google :-)

Thanks,

Ryan

oxbaker

8:23 pm on May 23, 2006 (gmt 0)

10+ Year Member



im answering this without any testing! so dont take my advice for 100% correct. This is what i would try however.

1.) Flash based solution. You can call js from either a server side page or (hopefully) a js file directly via the LoadVars object in flash.
LoadVars has two methods of interest. send and sendAndLoad. look into them to either call the js function from a server-side page, or hook into the ad server directly. It could work.

Option 2)
DHTML Faker.

This would be tricky to get to work across all browsers, but FAILING the LoadVars test, i would attempt to create a DHTML page that utilizes the flash object on a lower z index than the ad. Presuming that the ad is flash based as well (which it may or may not be depending on your adSense account) it should hold a higher position in the Z index and with CSS Absolute positioning you may be able to make it "sit" over top of your movie in the spot you want. This is a total hack and you should attempt the server side approach first. But these are two things i'd look into.

hth,
mcm

lsiryan

1:32 am on May 25, 2006 (gmt 0)

10+ Year Member



Hmmm let me look into that first one this weekend.

That second idea is quite clever actually.... I never would have thought of that, but it sounds like it would work.

Thanks

Ryan