Sunday, March 30, 2008

Embedding Flash Background Info - Start Here!

In this section, we will show you how to embed flash media into an html web page. Later posts describe Flash video and Flash audio specifically, but the basics are presented here.

First, let's look at the simplest way to embed a Flash file on your web page.


<html>
<body>

<object width="400" height="300">
<param name="movie" value="myflashfile.swf">
<embed src="myflashfile.swf" width="400" height="300">
</embed>
</object>

</body>
</html>


Just replace "myflashfile.swf" with the name of your .swf file. The width and height indicate the dimensions of the Flash content that will be displayed in the browser. If you use dimensions that are larger or smaller than the actual size, it will be scaled to your settings.

The above html assumes that the .swf file is in the same directory as your html file (e.g. your PRISM account). However, we want to our file to be hosted on a streaming server. To do this, simply upload your .swf file to Typhoon. Now, return to your html file. Change myflashfile.swf to the URL of your file on Typhoon. It will look like this:

src="http://newstream.gatech.edu/public/vol1/relay/Spring2008/Your_Name_Here/Your_File_Here.swf"

The above method is a good starting point, but it will not be sufficient for supporting a wide range of Internet browsers. To improve your html, a few attributes should be added to the object and embed tags. Our recommendation is to let Flash do this for you. Open your Flash file and choose File > Publish. Flash will automatically generate an html file with your content embedded. You will still need to edit the value and src attributes as we did in the first example.

The embedding Flash tutorial continues here: Introduction to embedding flash into html

No comments: