Forum Moderators: open
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
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