1. Home
  2. Computing & Technology
  3. Animation

Incorporating Google Adsense into Flash Web Pages

By , About.com Guide

Web design today tends to combine multiple platforms and technologies to deliver hybrid functionalities that provide a rich and personalized interactive experience. From saving user information to animated interfaces, it's possible to merge Flash with any number of web languages and platforms to customize just how your data reaches your target audience within your user interface, and what the audience returns to you.

Content delivery is a rich and multivaried thing - even when that content includes ads. Google Adsense is a popular way to turn even the most casual website into a source of income, whether minor or major, and many people try to incorporate Google ads into the layout of their site. That can create a bit of difficulty in a primarily Flash-based site design, where the majority of visual elements are objects within an SWF file rather than coded in HTML, XML, ASP, or any other number of languages. Google Ads are generally text-based, or dynamically pulled images--but they rely on code embedded in your page. Embedding HTML inside Flash can be difficult, problematic, and an all-around PITA - but there's an easy way to avoid it.

The simple answer is to design around it.

Not quite sure what I mean? It's easy.

It's a common misconception that when you design a website in Flash, the entire thing must be contained within a single SWF. Not so; you can create multiple SWF files and embed them into an HTML page (even better, embed them into a dynamic template using PHP or ASP to make updating the design and content easier across the entire site), using CSS or tables to position the various elements to create your overall graphical design. This gives you the freedom to embed the Google code wherever you wish, because you aren't bound by what you can do in ActionScripting alone. With the right design sense and an understanding of how various elements fit together, you can use basic HTML to seamlessly integrate Google Adsense content into your Flash-based site.

The key is to remember that your Flash content is a component of your website, and not the website in its entirety. When you view your Flash-based designs as interlocking pieces rather than attempting to lock all functionality and form within an SWF, you'll find a whole new world of flexibility in design and interactivity opening to you.

Explore Animation
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Animation
  4. Flash Animation Tutorials
  5. Web-Related Flash Lessons
  6. Incorporating Google Adsense into Flash Web Pages

©2009 About.com, a part of The New York Times Company.

All rights reserved.