[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
loading media from XML file
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