Flash Tutorials - Herong's Tutorial Examples - v3.03, by Dr. Herong Yang
"embed" Element with Flash Parameters
This section provides a tutorial example on how to integrate mp3player into Web pages using 'embed' elements and extra attributes to specify mp3player configuration parameters.
From previous chapters, we also learned that Flash SWF files can be integrated into Web pages using "embed" elements.
I want to try to integrate mp3player in an "embed" element and need to solve the issue on how to specify the special parameter "FlashVars" required by mp3player.
Reading the HTML 5 specification again, I found that "embed" element can support "Any other attribute that has no namespace".
Here is my tutorial example on how to integrate mp3player using an "embed" element:
<html><body> <!-- mp3player_embed_param.html - Copyright (c) 2014, HerongYang.com, All Rights Reserved. --> <p>mp3player with "embed" element:</p> <embed src="player_mp3_maxi.swf" width="200" height="20" wmode="transparent" FlashVars="mp3=Music_Sample.mp3&config=mp3player_config.txt"> </embed> </body></html>
Surprisingly, both Firefox 3 and IE 8 can play this example correctly as a remote Web page. If you open it as a local file, IE 8 will give you the regular security warning message.
I have included the above code here on this page.
If you are reading the Web version of this book,
you should be able to see mp3player displayed and you can play it.
Otherwise, you will see a static image.
Table of Contents