One most popular way of publishing a Flash movie is to embed the swf into a web page making it available to ubiquitous web browsers.
This article will go through the skills and tricks of the communication between a web page and its embedding Flash movie.
l Embedding your movie into a web page
Since version 2.0, Shockwave Flash plug-in supports Netscape’s LiveConnect and the scripting capability for Microsoft ActiveX has been greatly enriched. At present, Internet Explorer and other mainstream browsers support Flash plug-in scripting to a satisfying level. Before you get your hand dirty you must ensure that the plug-in support (e.g. ActiveX for IE or LiveConnect for NN) is enabled and correct version of Flash plug-in is properly installed. ActiveX Shockwave Flash plug-in provides additional events and properties for scripting to other versions. This article will feature on ActiveX plug-in.
Once you finish your movie in the Flash authoring environment you can choose file->publish or press Shift+F2 to publish it in an HTML document. The following HTML code to hold your swf will be found between the <body></body> tags of the generated HTML document.
<!–url’s used in the movie–>
<!–text used in the movie–>
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="550" height="400" id="mosquito" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="mosquito.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="mosquito.swf" quality="high" bgcolor="#ffffff" width="550" height="400"
name="mosquito" align="middle" allowScriptAccess="sameDomain"
type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
l Understanding the embedded Flash movie
There are some very important and mostly concerned attributes/parameters that I’d like to mention.
The src attribute or the movie parameter indicates the URL of the swf to be embedded. Modify both items to the URL where your swf is.
In most cases we want our movies to have a transparent background. This can be easily accomplished by setting the wmode attribute/parameter to "Tansparent". If you also want you swf to interact with HTML layers so that you can specify the z-index, please use "Transparent windowless". But beware that it’s only OK in Windows with the Flash Player ActiveX control and the <object> tag must be present.
For a detailed list of supported parameters and attributes, please consult Macromedia‘s official document: