Hi,
Quick summary before I pose my question. I have windows media player embedded (hidden) and use images to control the player (play buttons, stop buttons, etc). I show a list of sentences generated dynamically through a database. Beside each sentence is a play and stop button that will connect the correct audio to the embedded windows player.
Along with these buttons, I have span tags that have unique id's (corresponding to the record count of a database.) For example:
1)buttons here<span id="Msg1" style="color:green"></span>
2)buttons here<span id="Msg2" style="color:green"></span>
3)buttons here<span id="Msg3" style="color:green"></span>
etc...
I use this script to display a message in the specific span tag I am targeting:
<SCRIPT FOR="MediaPlayer" EVENT="buffering(Start)">
Msg.innerText = " Buffering..."
</SCRIPT>
But ofcourse the id in the above script is not correct. Now I am able to grab the number I want but I still cannot refer to the correct ID. For example:
<SCRIPT FOR="MediaPlayer" EVENT="buffering(Start)">
newMsg = "Msg"+newNumber //newNumber is the number
//I am able to get
newMsg.innerText = " Buffering..."
</SCRIPT>
So my question is: How can I refer to an id that is generated dynamically? The span tag id will always be "Msg" plus some number. My attempt is pretty lame but I am not sure how to go about this. Maybe naming the variable dynamically is not the correct approach. Any ideas would be greatly appreciated.
PS. I need all these span tags so I can't use the solution of just having one.
Thanks
Quick summary before I pose my question. I have windows media player embedded (hidden) and use images to control the player (play buttons, stop buttons, etc). I show a list of sentences generated dynamically through a database. Beside each sentence is a play and stop button that will connect the correct audio to the embedded windows player.
Along with these buttons, I have span tags that have unique id's (corresponding to the record count of a database.) For example:
1)buttons here<span id="Msg1" style="color:green"></span>
2)buttons here<span id="Msg2" style="color:green"></span>
3)buttons here<span id="Msg3" style="color:green"></span>
etc...
I use this script to display a message in the specific span tag I am targeting:
<SCRIPT FOR="MediaPlayer" EVENT="buffering(Start)">
Msg.innerText = " Buffering..."
</SCRIPT>
But ofcourse the id in the above script is not correct. Now I am able to grab the number I want but I still cannot refer to the correct ID. For example:
<SCRIPT FOR="MediaPlayer" EVENT="buffering(Start)">
newMsg = "Msg"+newNumber //newNumber is the number
//I am able to get
newMsg.innerText = " Buffering..."
</SCRIPT>
So my question is: How can I refer to an id that is generated dynamically? The span tag id will always be "Msg" plus some number. My attempt is pretty lame but I am not sure how to go about this. Maybe naming the variable dynamically is not the correct approach. Any ideas would be greatly appreciated.
PS. I need all these span tags so I can't use the solution of just having one.
Thanks