Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 12-28-2005, 06:52 AM   #1
Member (6 bit)
 
spudmurf2k's Avatar
 
Join Date: Nov 2002
Location: Ireland
Posts: 60
Send a message via AIM to spudmurf2k Send a message via MSN to spudmurf2k Send a message via Yahoo to spudmurf2k
Javascript (and to a lesser extent QuickTime) Problem

Hi,

I'm very much a newbie to javascript, I do a lot of php and need now a bit of javascript to control a narration on a website which is run as an mp3 thru the quicktime plug-in. The plug-in is working fine and I've written javascript to pause and play the narration through the pages own button.

The next task was to get it to move to the next slide after the narration has finished, so I decided to do a javascript re-direct after the time returned by the int GetDuration() command which the apple site says returns the length of the movie. (developer.apple.com...atsNew-74.html)

However, it doesn't work, and IE keeps telling me "'redirTime' is undefined". The script is below, as is the embed tag for the movie.

HTML Code:
<script language="javascript">
<!--
redirTime = document.narration.GetDuration()*1000;
redirURL = "slides.php?slide=<?php echo $nextslide; ?>";
function redirTimer() { 
	self.setTimeout("self.location.href = redirURL;",redirTime); 
	}
//-->
</script>
HTML Code:
<body onLoad="redirTimer()">
<OBJECT classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="1" height="1" id="narration">
<PARAM name="src" value="<?php echo $narrationpath; ?>"><EMBED width="1" height="1" src="<?php echo $narrationpath; ?>" name="narration" loop="false" enablejavascript="true" />
</OBJECT>
I'm sure there's just some OOP thing i'm missing regarding variable names or something, as I said, javascript newbie! Thanks in advance for any help.
spudmurf2k is offline   Reply With Quote
Old 12-28-2005, 02:53 PM   #2
Staff
Premium Member
 
mairving's Avatar
 
Join Date: Jul 1999
Location: Arlington, TN
Posts: 5,538
Is the script placed between the <head> </head> tags or in the body of the page?

Have you tested it in Firefox? If so did it come up with the same error?
__________________

Want to Make $$$$ with your Computer? No Risk! Simply press shift-4 four times in a row
mairving is offline   Reply With Quote
Old 12-30-2005, 01:33 PM   #3
Member (6 bit)
 
spudmurf2k's Avatar
 
Join Date: Nov 2002
Location: Ireland
Posts: 60
Send a message via AIM to spudmurf2k Send a message via MSN to spudmurf2k Send a message via Yahoo to spudmurf2k
Thanks for the reply. Of course I had it in the head tag, and it was having the same buzz with firefox. It transpires one of the errors can be to do with the id and name of two different objects being the same ('narration') and so document.narration.someProperty returns a node, or something similar to what Ive said, (if sum1 can explain thisto me I'd be much obliged)

Ive got around it by storing the length of each clip in the db and propagating it into the meta tags. Thanks.
spudmurf2k is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 05:02 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2