Flash Tutorials - Herong's Tutorial Examples - v3.03, by Dr. Herong Yang
"object" Element with Flash Parameters
This section provides a tutorial example on how to provide Flash parameters in 'object' elements. The SWF file is provided twice, in the 'data' attribute and in the 'movie' parameter.
If you look at the source code of "mp3player" examples presented in previous sections, you will see that 3 "param" sub elements are used to provide special parameters to the Flash Player: "movie", "wmode" and "FlashVars".
The use of "movie" parameter to provide the SWF file seems to be unnecessary, because the SWF file is already provided in the "object[@data]" attribute:
<object data="player_mp3_maxi.swf" ...> <param name="movie" value="player_mp3_maxi.swf"/> <param name="wmode" value="transparent"/> <param name="FlashVars" value=".../> </object>
In order to understand why we need specify the SWF file twice, I wrote the following tutorial example, mp3player_object_param.html:
<html><body> <!-- mp3player_object_param.html - Copyright (c) 2014, HerongYang.com, All Rights Reserved. --> <p>mp3player Test 1:</p> <object type="application/x-shockwave-flash" data="player_mp3_maxi.swf" width="200" height="20"> <param name="wmode" value="transparent"/> <param name="movie" value="player_mp3_maxi.swf"/> <param name="FlashVars" value="mp3=Music_Sample.mp3&config=mp3player_config.txt"/> </object> <p>mp3player Test 2:</p> <object type="application/x-shockwave-flash" width="200" height="20"> <param name="wmode" value="transparent"/> <param name="movie" value="player_mp3_maxi.swf"/> <param name="FlashVars" value="mp3=Music_Sample.mp3&config=mp3player_config.txt"/> </object> <p>mp3player Test 3:</p> <object type="application/x-shockwave-flash" data="player_mp3_maxi.swf" width="200" height="20"> <param name="wmode" value="transparent"/> <param name="FlashVars" value="mp3=Music_Sample.mp3&config=mp3player_config.txt"/> </object> <p>mp3player Test 4:</p> <object data="player_mp3_maxi.swf" width="200" height="20"> <param name="wmode" value="transparent"/> <param name="FlashVars" value="mp3=Music_Sample.mp3&config=mp3player_config.txt"/> </object> </body></html>
4 tests are included in this example. Can you take a guess on which tests will be played correctly on Firefox and IE?
Table of Contents
Adobe Flash Player Plugin for Firefox
Adobe Flash Player Plugin for Chrome
Adobe Flash Player Plugin for Safari
Adobe Flash Player ActiveX for IE
Using "object" Elements for Flash Files
Using "embed" Elements for Flash Files
►"mp3player" - MP3 Music Player
Downloading and Testing "mp3player"
Integrating "mp3player" in Web Pages
"mp3player" Configuration Parameters
"mp3player" Controlled by JavaScript Code
►"object" Element with Flash Parameters
"object" Element with Flash Parameters - Firefox 3
"object" Element with Flash Parameters - IE 8
"embed" Element with Flash Parameters
SWFObject - Hidding "object" behind JavaScript
SWFTools - SWF File Manipulation Tools
SWFC Script to Generate Flash SWF Files
ActionScript Embedded in SWFC Script
AS3Compile - ActionScript 3 Compiler