| |
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:
If you like this post, then consider subscribing to our full feed RSS.
|
|