Web Design with HTML and CSS

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

Lesson 10, Introduction to Interactivity 233

6 Return to your insertFlash.html fi le and scroll to locate the line

Recipe of the
Day: Honeydew Melon

. Click once above this heading and paste the code you
just copied.


Add the multiple lines of <object> code immediately before the <h3> heading.

Now you need to update the link to your new SWF fi le and a few other properties.

7 Locate the following line of code:


<param name="movie" value="smoothie_ad.swf" />
Change the value to point to a Flash fi le located in the FlashAssets folder in your
web10lessons folder (highlighted in red):
<param name="movie" value="FlashAssets/smoothie_ad.swf" />
There is another object element nested within the fi rst object element, so you need to
update the link to the SWF fi le again. This second object element is needed for certain
versions of Internet Explorer.

8 Locate the second object tag and modify this code (highlighted in red):


<!--[if !IE]>-->
<object type="application/x-shockwave-fl ash" data="FlashAssets/
smoothie_ad.swf" width="220" height="250">
<!--<![endif]-->
There are two remaining steps: you must update the ID name for this Flash object and
update the reference to the ID in your JavaScript.

9 In the fi rst tag, update the name of the ID (highlighted in red):


<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
width="220" height="250" id="smoothiead">
Scroll to your head section and make sure the reference to this ID is updated in your last
<script> tag (highlighted in red):
<script type="text/javascript">swfobject.
registerObject("smoothiead", "9.0.0");
</script>