Adding Metadata to Your Flash Creation

 < Day Day Up > 

There are two primary ways you can expose your Flash creations to search engines: You can add keywords into the .html file's comments or add a title and description to the .swf file. The first (metadata in the HTML) has been around for a while, and every search engine should be reading this data already. That is, while search engines are continually crawling the Web, they pick up words that you place in the .html. You can insert keywords you think apply to your content, and search engines will point to your page. You can increase the likelihood your page will get linked to by studying search engine optimization (SEO) techniques. In addition to stuffing keywords into your .html, Flash 8 does not support embedding metadata in the form of a title and description. Search engines are just beginning to extract these two elements from a .swf. (In fact, users can already search the contents of .swf files by adding the text filetype:swf to the end of their search, but this isn't very useful because it includes everything in the .swf not just keywords.) You should follow a couple standard guidelines for what to put into the title and description. Specifically, put a clear and concise name into the title and a detailed overview into the description.

Try It Yourself: Add Metadata for Search Engine Optimization

In this task, you'll embed both keywords into the .html and metadata into the .swf itself. Here are the steps:


Create a new movie and place the text click me onstage. With the text selected, open the Properties panel and make sure the text is set to Static. Also, fill in the URL link field with a URL of your choice, say Save the .fla in a known location.


Select File, Publish and click the Formats tab. Select the check boxes next to Flash and HTML. From the HTML tab, ensure the Detect Flash Version is not selected. (The additional script just makes it harder to edit the .html file you can still add metadata when detecting the Flash version.)


Select Publish and then use a text editor to open the .html file. Notice the following comment, starting on line 9 (comments are separated by <!-- and -->):

 <!--url's used in the movie--> <!--text used in the movie--> 


Flash inserts another comment right after this that includes, in HTML format, the click me text and the corresponding link. Provided the search engine looks at comments, it will digest this as if the text and link were regular HTML (not hidden inside the .swf). You're welcome to modify or add to these comments. Just remember that each comment needs to begin with <!-- and end with -->.


Because some search engines won't bother reading (and then indexing) your comments, you need to go a step further. Return to your Flash file and select Modify, Document. Fill in the Title field with Phillip Kerman's Best Animation and the Description with A riveting and entertaining Macromedia Flash animation created by Phillip Kerman, author of Sams Teach Yourself Flash 8 in 24 Hours and other books. Obviously, you can use any text you want, but the main idea is you want a short title and complete description.


Click OK in the Document Properties dialog and select File, Publish again. You won't notice anything new in the .html file, but it effectively has two new lines in the HEAD section. Like I say, it's not really in the .html but rather in the .swf, but if it were in the .html it would look like this:

 <meta name="title" content="Phillip Kerman's Best..."> <meta name="description" content="A riveting and entertaining..."> 

At this point you can upload your files (as you learned in Hour 19) then sit back and wait for the world to beat a path to your site. I'm half joking because, like I said earlier, there are other general search engine optimizations that you might want to employ. At this point, however, you've done what you can with Flash: injected comments into the .html and metadata into the .swf.

     < Day Day Up > 

    Sams Teach Yourself Macromedia Flash 8 in 24 Hours
    Sams Teach Yourself Macromedia Flash 8 in 24 Hours
    ISBN: 0672327546
    EAN: 2147483647
    Year: 2006
    Pages: 235

    Similar book on Amazon © 2008-2017.
    If you may any questions please contact us: