3. Add Flash to Web Pages
‣ Deliver FlashHTML pages by embedding
SWF files in
to your users
‣ Allows you to control the size and
display preferences
‣ Several ways to do this:
‣ Add static embed code to your HTML
pages
‣ Use Adobe Flash to "publish" the code
‣ Use a dynamic method with JavaScript
5. Embed tag
<embed type="application/x-shockwave-flash"
src="myContent.swf" width="300" height="120"
pluginspage="http://www.adobe.com/go/getflashplayer" />
<noembed>Alternate content</noembed>
•Advantages
‣ Simple and clean
‣ Chosen for widespread use by Google Video,
YouTube, and others
•Disadvantages
‣ Does not validate aspart of the XHTML The
<embed> tag is not
XHTML compliant.
specification.
6. Object tag
<object type="application/x-shockwave-flash"
data="myContent.swf" width="300" height="120">
<p>Alternate content</p>
</object>
Variation required by Internet Explorer:
<object classid="clsid:D27CDB6E-
AE6D-11cf-96B8-444553540000" width="300" height="120">
<param name="movie" value="myContent.swf" />
<p>Alternate content</p>
</object>
7. Object tag: Nested
• To get the object tag to work as one block of code in the two ways it
can written, nest them with IE conditional tags:
<object classid="clsid:D27CDB6E-
AE6D-11cf-96B8-444553540000"
width="300" height="120">
<param name="movie" value="myContent.swf" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash"
data="myContent.sw" width="300" height="120">
<!--<![endif]-->
<p>Alternate content</p>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
8. "Flash Embedding Cage
Match"
by Bobby van der Sluis,
A List Apart, http://
www.alistapart.com/articles/
flashembedcagematch
10. Publish Settings
• File > Publish Settings…
‣ Determines how SWF and other files
appear when published from other
menus, including Test Movie
‣ Choose Format, Flash, and HTML
options
‣ Use version detection to load alternate
content
‣ File > Export... allows more flexibility
when creating Quicktime files
16. Checking if the movie has
loaded
‣ Use the first keyframe for
ActionScript that will check if the
movie has loaded.
‣ The preloader will play in the first
keyframe until the movie has
loaded.
20. Timeline
March April May Last day of class
9 16 23 30 6* 13 20 27 4 11 18 25
Create a project title and description
Present final projects
Paper prototypes (two days)
Design background, characters,
and other game elements
Embed game elements in game symbol
Add movement and keyboard interaction
Add Start and Game Over screens
Add scoring and
game over trigger
21. Homework
• Work on your final projects
‣ Add scoring and game over trigger