INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Streaming Media

Swapping images and controlling the player by tanderso
Posted: 27 Dec 00

In order to provide custom graphical controls which respond in both the player and the graphic, you'll have to set up functions which handle both tasks.  Below is a simple example:

<head>
<script>
var stop_on = new Image();
stop_on.src = "stop_on.gif";
var stop_off = new Image();
stop_off.src = "stop_off.gif";
var play_on = new Image();
play_on.src = "play_on.gif";
var play_off = new Image();
play_off.src = "play_off.gif";
var pause_on = new Image();
pause_on.src = "pause_on.gif";
var pause_off = new Image();
pause_off.src = "pause_off.gif";

function swap(img,which)
{
  eval("document."+img+".src="+img+"_"+which+".src");
}

function stop_player()
{
  swap("stop","on");
  swap("play","off");
  swap("pause","off");

  Player.stop();
}

function pause_player()
{
  swap("stop","off");
  swap("play","off");
  swap("pause","on");

  Player.pause();
}

function play_player()
{
  swap("stop","off");
  swap("play","on");
  swap("pause","off");

  Player.play();
}
</script>
</head>

<body>
<a href="javascript:stop_player()"><img src="stop_off.gif" name="stop"></a>
<a href="javascript:pause_player()"><img src="pause_off.gif" name="pause"></a>
<a href="javascript:play_player()"><img src="play_off.gif" name="play"></a>
</body>

Back to HTML, XHTML & CSS FAQ Index
Back to HTML, XHTML & CSS Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close