swfobject.js - Using Flashvars

hankknight
hankknight used Ask the Experts™
on
I would like to add this Flash application to my website.
http://sites.google.com/site/adsffadsf/Home/eePlayer.zip?attredirects=0&d=1

This file works correctly:
flashvars.html

But this file does NOT work correctly:
js.html

The problem is with my implementation of swfobject.js.  I do not know how to properly pass Flashvars using swfobject.js.




Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Hi Hankknight,

Try this code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Demo</title>

<style type="text/css">

</style>

<script type="text/javascript" src="player/swfobject.js"></script>
		<script type="text/javascript">
			var flashvars = {};
			flashvars.playlist = "1.mp3,mp3/2.mp3,mp3/3.mp3,mp3/4.mp3";
			var params = {};
			params.quality = "high";
			params.allowfullscreen = "false";
			params.allowscriptaccess = "sameDomain";
			var attributes = {};
			attributes.id = "menu";
			swfobject.embedSWF("player/mp3.swf?v=" + Math.floor(Math.random()*9999), "audioPlayer", "400", "400", "6.0.0", false, flashvars, params, attributes);
		</script>
</head>
<body>

<h1>Hello</h1>
<div id="audioPlayer"></div>
<hr />
<h2>Footer</h2>

</body>
</html>

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial