[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

loading media from XML file


xmldso
Hello all, I'm just starting to learn XML and am already having some
trouble.

I have a VERY SIMPLE XML file called test01.xml, which contains a list
of file names for slides and respective narration files (wma):
__________________________________________________
<?xml version="1.0"?>

<pres_1>

	<!-- slide 1 -->
	<slide>
		<image>t1graphics/pres1sld2.gif</image>
		<audio>t1narrations/slide02.wma</audio>
	</slide>
	<!-- slide 2 -->
	<slide>
		<image>t1graphics/pres1sld3.gif</image>
		<audio>t1narrations/slide03.wma</audio>
	</slide>
	<!-- slide 3 -->
	<slide>
		<image>t1graphics/pres1sld4.gif</image>
		<audio>t1narrations/slide04.wma</audio>
	</slide>
	<!-- slide 4 -->
	<slide>
		<image>t1graphics\pres1sld5.gif</image>
		<audio>t1narrations\slide05.wma</audio>
	</slide>
	<!-- slide 5 -->
	<slide>
		<image>t1graphics\pres1sld6.gif</image>
		<audio>t1narrations\slide06.wma</audio>
	</slide>

</pres_1>
__________________________________________________

I also have a simple HTML file that calls these slides and narrations,
one by one when the user clicks on the next or previous slide buttons.
The slides (graphics) always work correctly, but the audio files don't,
it's always loading the same file, the first narration.

I decided to display the file names on the page to check what's going
on, and every time I click on the next slide button, the name of the
first narration files flashes quickly on the page, then the correct file
name shows up. But by that time, the first file is already loaded and
playing.

Why? What am I doing wrong?
__________________________________________________
<html>
<head>
<script language="JavaScript">

function movenext()
{
if (xmldso.recordset.absoluteposition < xmldso.recordset.recordcount)
{
xmldso.recordset.movenext()
}
}

function moveprevious()
{
if (xmldso.recordset.absoluteposition > 1)
{
xmldso.recordset.moveprevious()
}
}
</script>

</head>
<body>

<xml src="test01.xml" id="xmldso" async="false"></xml>
<p>

<table>
  <tr>
    <td><img src=<span ID="image" datasrc="#xmldso"
datafld="image"></span></td>
  </tr>

  <tr>
    <td>
      <OBJECT ID="MMPlayer1" WIDTH=470 HEIGHT=70
classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"CODEBASE="http://act
ivex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.
cab#Version=5,1,52,701" standby="Loading Microsoft Windows Media Player
components..." type="application/x-oleobject">
      <PARAM NAME="FileName" VALUE=<span ID="audio" datasrc="#xmldso"
datafld="audio"></span>>
      <PARAM NAME="ShowControls" VALUE="1">
      <PARAM NAME="ShowStatusBar" VALUE="1">
      <PARAM NAME="ShowDisplay" VALUE="0">
      <PARAM NAME="Autostart" VALUE="1">
      <Embed type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/Windows/MediaPlayer/download/defau
lt.asp" src=<span ID="audio" datasrc="#xmldso" datafld="audio"></span>
Name=MMPlayer1 Autostart=1 ShowControls=1 ShowDisplay=0
ShowStatusBar=1DefaultFrame="Slide" width=470 height=70>
      </embed>
      </OBJECT>
    </td>
  </tr>
</table>

<p>
<input type="button" value="Next Slide" onclick="moveprevious()">
<input type="button" value="Prev Slide" onclick="movenext()">
</p>
<br><span ID="graphic" datasrc="#xmldso" datafld="image"></span>
<br><span ID="narration" datasrc="#xmldso" datafld="audio"></span>

</body>
</html>
__________________________________________________

I'd really appreciate ANY help!!!!  I can send the gif and wma media
files in case somebody needs it.

Thanks!!! ;-)


Marcia
ICQ: 9618920			




PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.