Home Forums
12 | 19 | 2014
We have 315 guests and 3 members online
JoomlaNook Forums
Welcome, Guest
Please Login or Register.    Lost Password?
JCE HsHtmlExpander Plugin
Go to bottom
TOPIC: SWFObject' is undefined
#5096
klowther
Admin
Posts: 3112
User Offline Click here to see the profile of this user
Gender: Male JoomlaNook Location: Fremont, NE USA Birthday: 07/23
Re:SWFObject' is undefined 3 Years, 10 Months ago  
Hi,I think it's a problem with file locationsI think you are right.

Normally Joomla takes care of resolving relative paths so that a path like 'images/stories..' turns into, in your case, '/clients/jt-DMS/images/stories...'. However, the handling of the html for the popup is done by highslide, outside of Joomla, so it has no way of resolving relative paths. That means that you must specify the paths yourself as '/client/jt-DMS/images/stories...' in the html file.

Please give that a try and let me know.

- Ken
 
Logged Logged
  The administrator has disabled public write access.
#5099
beccahan
Posts: 12
User Offline Click here to see the profile of this user
Re:SWFObject' is undefined 3 Years, 10 Months ago  
Thanks Ken.
I changed the html file so that there are full paths pointing to the HS files. I've copied the contents of my html file below.

Still getting the same error, saying the SWFObject is undefined and pointing to line 28 in the html file. That's the one that starts: var s1 = new SWFObject('player.swf', etc.). Is there something wrong with the syntax in that line of code? Or is Highslide having trouble finding the player file, which is in the same directory as the html file?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "xhtml11.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Highslide JS with JW FLV MediaPlayer</title>

<!--
1 ) Reference to the files containing the JavaScript and CSS.
These files must be located on your server.
-->

<script type="text/javascript" src="www.rhcvisualwriting.com/clients/jt-DMS/...;></script>
<script type="text/javascript" src="www.rhcvisualwriting.com/clients/jt-DMS/...;></script>
<script type="text/javascript" src="www.rhcvisualwriting.com/clients/jt-DMS/...;></script>
<link rel="stylesheet" type="text/css" href="www.rhcvisualwriting.com/clients/jt-DMS/...sitestyles.css" />

</head>
<body>
<div id="player"></div>

<!--
2) Change the video sizes in the SWFObject parameters and
the file name references in the flashvars specification.
-->

<script type='text/javascript'>
var s1 = new SWFObject('player.swf','mpl','480','270','8');
s1.addParam('allowfullscreen','true');
s1.addParam('allowscriptaccess','always');
s1.addParam('vmode','transparent');
s1.addParam('flashvars','&file=jtDMS.flv&image=jtDMSvideo.PNG&backcolor=000000&frontcolor=ffffff&lightcolor=555555&screencolor=000000&screencolor=000000&stretching=fill');
s1.write('player');
</script>
</body>
</html>
 
Logged Logged
  The administrator has disabled public write access.
#5100
klowther
Admin
Posts: 3112
User Offline Click here to see the profile of this user
Gender: Male JoomlaNook Location: Fremont, NE USA Birthday: 07/23
Re:SWFObject' is undefined 3 Years, 10 Months ago  
Hi,

Ok, I looked on your site and can't find the swfobject.js file where it should be if you have the highslide plugin installed. Other highslide files are there but the swfobject.js file seems to be missing.

As well, the updated example that I mentioned earlier also shows different html requirements. See below:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "xhtml11.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>JW FLV mediaplayer version 5.4</title>

<!--
1 ) Reference to the files containing the JavaScript and CSS.
These files must be located on your server.
-->

<script type="text/javascript" src="/plugins/content/highslide/swfobject.js"></script>

</head>
<body>
<div id="container1"></div>

<!--
2) Change the video sizes in the swfobject parameters and
the file name references in the flashvars specification.
-->

<script type="text/javascript">
var flashvars = { file:'video.mp4',autostart:'true' };
var params = { allowfullscreen:'true', allowscriptaccess:'always' };
var attributes = { id:'player1', name:'player1' };

swfobject.embedSWF('player.swf','container1','480','270','9.0.115','false',
flashvars, params, attributes);
</script>
</body>
</html>


Notice the different syntax for the statements invoking the swf object.

- Ken
 
Logged Logged
  The administrator has disabled public write access.
#5102
beccahan
Posts: 12
User Offline Click here to see the profile of this user
Re:SWFObject' is undefined 3 Years, 10 Months ago  
Ok, thanks Ken. My mistake: I was still using the outdated HTML example as a template. I've now changed my HTML file to match the syntax in the new example, and have copied the contents of my file below so you can check it. My swfobject.js file is in the location specified in this file. I tried using the filepath your example gave (plugins/content/highslide/swfobject.js) and the one below that moves up several directories from /images/stories/highslide, where the html file, video and player.swf files are located.
I'm still getting the same error: SWFObject is undefined.



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "xhtml11.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>JW FLV mediaplayer version 5.4</title>

<!--
1 ) Reference to the files containing the JavaScript and CSS.
These files must be located on your server.
-->

<script type="text/javascript" src="../../../plugins/content/highslide/swfobject.js"></script>

</head>
<body>
<div id="container1"></div>

<!--
2) Change the video sizes in the SWFObject parameters and
the file name references in the flashvars specification.
-->

<script type="text/javascript">
var flashvars = { file:'jtDMS.flv',autostart:'true' };
var params = { allowfullscreen:'true', allowscriptaccess:'always' };
var attributes = { id:'player1', name:'player1' };

swfobject.embedSWF('player.swf','container1','480','270','9.0.115','false',
flashvars, params, attributes);
</script>
</body>
</html>
 
Logged Logged
  The administrator has disabled public write access.
#5103
klowther
Admin
Posts: 3112
User Offline Click here to see the profile of this user
Gender: Male JoomlaNook Location: Fremont, NE USA Birthday: 07/23
Re:SWFObject' is undefined 3 Years, 10 Months ago  
Hi,

I think the only way that you are going to be able to get it to work is to use an absolute path like this:

<script type="text/javascript" src="/clients/jt-DMS/plugins/content/highslide/swfobject.js"></script>

- Ken
 
Logged Logged
  The administrator has disabled public write access.
#5105
beccahan
Posts: 12
User Offline Click here to see the profile of this user
Re:SWFObject' is undefined 3 Years, 10 Months ago  
HOORAY!!!!!!
That works!
Thank you Ken!
 
Logged Logged
  The administrator has disabled public write access.
Go to top