Internet Marketing Blog
Home      Archives      Tools      Advertising      About      Contact      Free Shipping Subscribe to our Full RSS Feed

 

How I Save Oodles of Time by Passing Text into Flash with Variables

Earlier this week I showed you how to get search engine credit for Flash content.

Today I am going to show you a simple time-saving technique I use to pass text into Flash through a variable that is set in the HTML.

The problem

For many of the web sites I design I create the title graphics in Flash rather than as images so that I can get H1 credit for the content. Creating a new SWF file for each page can be very time consuming. It would take me hours to create all of the Flash files for the titles on a site with hundreds of pages. There must be a better solution.

The solution

I create one SWF file for all the title graphics on the site. The SWF file has a dynamic text element in it that gets passed a variable from the HTML file. The variable is displayed in the SWF file on the page.

The Flash part

  • In a new Flash document use the text tool to create a text element on the stage.
  • Set the font, color and size of the text element.
  • With the text element selected change the text type to Dynamic Text from Static Text in the Properties Tab.
  • Set the Variable of the text element to ‘content’ in the Properties Tab.
  • Include the font you are using by clicking on the Embed button in the Properties Tab.
  • A pop up box will appear with a list of characters that you can embed. Choose the characters that will be in your titles. (If you don’t embed any characters, the font displayed on computers that don’t have the font you selected will be a generic font.)
  • Since we are passing our text into the SWF through our HTML file, delete any text that might be in the text element.
  • Publish your SWF file.

The HTML part

  • Insert the SWF element in your HTML file. If you are using the code provided in my How to Get Search Credit For Flash Content, your HTML file should look something like:

    <h1>Internet Marketing</h1>
    <script>loadFlashSEO("h1", "swf/title.swf", 550, 100, "swf/")</script>

  • Add ‘?content=Internet Marketing‘ after the file name so that the code looks like:

    <h1>Internet Marketing !</h1>
    <script>loadFlashSEO("h1", "swf/title.swf?content=Internet Marketing", 550, 100, "swf/")</script>

    This passes our variable ‘Internet Marketing’ into the SWF file through the variable ‘content’. ‘Internet Marketing’ should now be displayed on the page for our title. Change ‘Internet Marketing’ to whatever you want the title to be on every HTML page.

Conclusion

Creating titles on new HTML pages and changing titles on old HTML pages can now be done in seconds rather than minutes. Over the last few years this technique has literally saved me days of development work.

Download the files


Spread the word: del.icio.us Digg Furl Reddit StumbleUpon Technorati

If you like this post, then consider subscribing to our full feed RSS.


       Posted in: Web Development
     by: Luke Knowles
Your Thoughts? [ 4 ]      
September 13, 2007       
 
 
   
  Comments (4)  
 

Nice tutorial, thank you. There is an easy way to make beautiful titles, right? It’ll be usefull for me.

       egorych September 14, 2007        
 
 

is there a way to pass in style parameters as well as URL in case the new title was to be used as a link/button?

       Aric January 24, 2008        
 
 

This is awesome! Took a little troubleshooting but I got it to work. Seems that the dynamic text field needs to be on the main timeline (as opposed to being part of a movie clip).

My question: Is this possible to do with images as well?

       Barsmoney April 4, 2008        
 
 

Das ist etwas besondere! Vielen Dank fuer Ihre Info.

       AllSana July 9, 2008        
 
  Leave a Comment
Please respond with a comment using the form below.

  
  
  
Comments

 
   
 
   
  Internet Marketing Campaigns  
  Sony Bravia Campaign Goes Viral Again
Dove Onslaught Viral Video
Into the Wild Internet Marketing Cross Promotion
Halo 3 Internet Marketing Campaign
Hundai - Lattes vs Airbags "Think About It"
Heinz Top This TV Challenge
McDonalds Uses Viral youTube Video in its Latest TV Ad
The Simpsons Movie Marketing Madness
 
  Must Read Posts  
  Free Shipping Web Site Launches
SEO For Wordpress Series
How to Make Money with Facebook
Everything You Need to Know About rel=nofollow
7 Tips For Starting Your Own Facebook Group
Internet Marketing Case Study: WH Bed & Breakfast
9 Ways to Improve Google Image Search Rankings
Free Samples Equals Viral Marketing Success
4 Reasons Not To Put Your Company in the Wikipedia
Learn How to Make Facebook Applications
Easy Auction Ads Wordpress Plugin
 
  Categories  
 
 
  RSS Feed  
  Subscribe to RSS
Subscribe by Email
 
  Search  
 
 
  Sites  
   
  Commenters
 
 
 
Home      Archives      Tools      Advertising      About      Contact      Coupons © 2010 Virtual Marketing Blog