HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
How to dynamically changing the source of an embedded sound?
Post new topic   Reply to topic    HTML Help Forum Index -> DHTML
View previous topic :: View next topic  
Author Message
kanenas



Joined: 14 Dec 2004
Posts: 191

PostPosted: Tue Dec 14, 2004 6:05 am     How to dynamically changing the source of an embedded sound? Reply with quote

Is it possible to use (e.g.) Javascript in order to change the source of a sound which was embedded using either an EMBED or OBJECT tag? If so, how is it done? The goal is to play different sound files using the same sound object without reloading the page.

If you need code, consider the question: "What is the appropriate definition of setSrc() so that the call to Play() will play bar.wav?" in terms of the following.

Code:

<embed id='foo' src='foo.wav' loop='0' autostart='false'>
<script type='text/javascript'><!--
    setSrc(document.getElementById('foo'), 'bar.wav');
    document.getElementById('foo').Play();
//--></script>
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> DHTML All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial