View Full Version : Music script and rollover script together

09-24-2003, 05:49 PM
yeah I have a music script that lets me have a stop and start button which i have very easily configured to play a music file and stop it when the users wants.
I also have a rollover image script which again can easily configure and have got working successfully.

The problem is that I would like them together, A music script with the stop and play buttons that rollover when you hover your mouse on them. so far I have just come back with erros.
can any of you help to get them together :p

<---Music script--->

<!-- Enter here the url or source of the image to turn on the background music as shown below -->
<!-- Enter here the url for the background sound -->
musi2="<? echo "$music"; ?>"
<!-- Don't edit from here on -->
document.write(" <div id='se2' style='position:absolute;left:-33333'><embed src='"+musi2+"' hidden=true autostart='true' loop=0></div>")
document.write("<img src="+ima2+" onclick=apag2() style='cursor:pointer'>")
function apag2(){
se2.innerHTML="<embed src='"+musi2+"' hidden=true autostart='true' loop=0>"

<!-- Enter here the url or source of the image to turn off the background music as shown below -->
<!-- Don't edit from here on -->
document.write("<img src="+ima21+" onclick=apag21() style='cursor:pointer'>")
function apag21(){

<---end music script--->

<---Start of Rollover images script-->
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

<body onLoad="MM_preloadImages('file:///C|/My%20Documents/web%20mania/images/play2.png','file:///C|/My%20Documents/web%20mania/images/stop2.png')">
<a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image3','','file:///C|/My%20Documents/web%20mania/images/stop2.png',1)"><img src="file:///C|/My%20Documents/web%20mania/images/stop2.png" name="Image3" width="24" height="24" border="0"></a><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image1','','file:///C|/My%20Documents/web%20mania/images/play2.png',1)"><img src="file:///C|/My%20Documents/web%20mania/images/play2.png" name="Image1" width="24" height="24" border="0"></a>

<---End of Rollover images script-->

Thank you