Web Design with HTML and CSS

(National Geographic (Little) Kids) #1
Interactivity on the web

Lesson 10, Introduction to Interactivity 229

Considerations when using Flash


Creating Flash content is not covered in this book; however, you will learn to add Flash content
to your page. Some details to keep in mind:


  • The Flash fi les you will add have the extension .swf. The authoring fi les that create the .swf
    fi le are also called Flash fi les, but these authoring fi les have the extension .fl a.

  • Flash requires a browser plugin called the Adobe Flash Player to work. If a user does not have
    this plugin, she cannot see your Flash content. However, the majority of web browsers have
    some version of the Flash plugin installed. You do need to be sensitive to which version your
    Flash content is targeted to. As of this writing, the most recent version of the Flash Player is
    10.1. If a user comes to your website and has version 9 of the Flash Player, any incompatible
    content designed for version 10 will not be displayed. (You can fi nd statistics on versions of
    Flash Player installed worldwide at http://www.adobe.com/products/player_census/fl ashplayer.)

  • Flash has made great progress over the years, but some concerns about accessibility remain.
    Before choosing to deliver content in Flash, remember that search engines do not index
    the text content in SWF fi les with the same reliability as standard HTML, so important
    information about your site might not appear on your web page. Also, Flash might not be
    supported or might have limited support on mobile devices; take this into consideration
    when deciding where to use Flash on your site.


Generating code to add Flash movies to a page


In this exercise, you will generate the code necessary to add Flash to a web page. Adding
Flash to a web page is similar to adding an image. However, the supporting code for Flash
fi les is more complex because: 1) over the years, diff erent web browsers have managed Flash
in diff erent ways and you need to account for these scenarios; 2) a user who does not have
the Flash plug-in could visit your site, in which case you need to provide alternative content;
3) a user who has an older version of the Flash plugin might visit your site, in which case
you need to provide an upgrade. The only way to do this is by using code.


For this exercise, you will use a JavaScript-based solution that lets you embed Flash fi les
while resolving these issues.


1 In your text editor, choose File > Open and then navigate to the swfobject folder located
in your web10lessons folder. Open the fi le SWFObject_generator.html. This fi le is a
stand-alone web page that will generate the necessary object code for you. This generator
is based on a project called SWFObject, which is an open source project that provides
designers and developers with a reliable way to add Flash fi les to their pages.


SWFObject is an open source project free for anyone to use with minimal restrictions.
As of this writing, the latest version of SWFObject is version 2.2. You can learn more
about the SWFObject project and access more in-depth documentation by visiting
http://code.google.com/p/swfobject.
Free download pdf