I have an interesting one here - I jave a client who wants a sound file to play whenever a user scrolls over a link/menu item ( external javascript menu system) Yea, I know, I've been around the midi-wav-mov thing and the best results I have at this point is an embeded swf file with the sound effect and stop start play triggers inside attached via actionscript the the audio.
there is an external soundcheck.js file (checks the browser version and writes the flash variables to the page - using a document.write)
the trigger on the page is <A href="#" target="_blank" onmouseover="mySwf.Play(); return false">Rollover Me</A>
the external js is:<SCRIPT LANGUAGE="JavaScript" SRC="arrays/efx.js"></SCRIPT>
and the js is
it works great on a page by itself but as you can see from the snippet below there are no parameters for me to address any other calls from the menu
so... bear with me... is there a way to have the onmouseover="mySwf.Play(); return false" function activate from ANY href rollover using css ( something like a:active { do_funtion(); }?? or a.something?
I'm not THAT good at css -- Thanks
.
there is an external soundcheck.js file (checks the browser version and writes the flash variables to the page - using a document.write)
the trigger on the page is <A href="#" target="_blank" onmouseover="mySwf.Play(); return false">Rollover Me</A>
the external js is:<SCRIPT LANGUAGE="JavaScript" SRC="arrays/efx.js"></SCRIPT>
and the js is
Code:
winIEpass = ((navigator.appName.indexOf("Microsoft") != -1) &&
(navigator.appVersion.indexOf("Windows") != -1)) &&
(parseFloat(navigator.appVersion) >= 4) ? true : false;
NNpass = ((navigator.appName == "Netscape") &&
(navigator.userAgent.indexOf("Mozilla") != -1) &&
(parseFloat(navigator.appVersion) >= 4) &&
(navigator.javaEnabled())) ? true : false;
supportedBrowser = (winIEpass || NNpass) ? true : false;
// check for Flash Plug-in in Mac or Win Navigator. Get plug-in version.
minPlayer = 4;
var mySwf;
function Flash_checkForPlugIn() {
var plugin = (navigator.mimeTypes &&
navigator.mimeTypes["application/x-shockwave-flash"]) ?
navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if (plugin) {
var pluginversion = parseInt(plugin.description.substring(plugin.description.indexOf(".")-1))
if(pluginversion >= minPlayer) {return true;}
}
return false;
}
// vbscript check for Flash ActiveX control in windows IE
if(supportedBrowser && winIEpass)
{
document.write(
'<script language=VBScript>' + '\n' +
'Function Flash_checkForActiveX()' + '\n' +
'Dim hasPlayer, playerversion' + '\n' +
'hasPlayer = false' + '\n' +
'playerversion = 10' + '\n' +
'Do While playerversion >= minPlayer' + '\n' +
'On Error Resume Next' + '\n' +
'hasPlayer = (IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash.\" & playerversion & \"\")))' + '\n' +
'If hasPlayer = true Then Exit Do' + '\n' +
'playerversion = playerversion - 1' + '\n' +
'Loop' + '\n' +
'Flash_checkForActiveX = hasPlayer' + '\n' +
'End Function' + '\n' +
'<\/script>'
);
}
function Flash_checkForMinPlayer()
{
if(!supportedBrowser) return false;
if(NNpass) return (Flash_checkForPlugIn());
if(winIEpass) return (Flash_checkForActiveX());
}
function Flash_embedSWF(srcURL, swfbgColor)
{
if (!Flash_checkForMinPlayer()) return;
var defaultColor = (document.bgColor != null) ? document.bgColor : "#ffffff";
var bgcolor = (swfbgColor != null) ? swfbgColor : defaultColor;
document.writeln(
'<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' +
'codebase="[URL unfurl="true"]http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0"'[/URL] +
'ID="sonify" WIDTH=1 HEIGHT=1>' +
'<PARAM NAME=movie VALUE="' + srcURL + '">' +
'<PARAM NAME=quality VALUE=low>' +
'<PARAM NAME=wmode VALUE=transparent>'+
'<PARAM NAME=bgcolor VALUE=' + bgcolor + '>' +
'<EMBED swLiveConnect="true" NAME="sonify"' +
'src="' + srcURL + '"' +
'quality=low' +
'wmode=transparent' +
'bgcolor=' + bgcolor +
'WIDTH=1 HEIGHT=2' +
'TYPE="application/x-shockwave-flash"'+
'PLUGINSPAGE="[URL unfurl="true"]http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">'[/URL] +
'</EMBED>' +
'</OBJECT>'
);
}
function sonified_flash(myFrame){
if(!Flash_checkForMinPlayer()) {return;}
mySwf = window.document.sonify;
if (mySwf.PercentLoaded()<100) return
mySwf.GotoFrame(myFrame);
mySwf.GotoFrame(0);
}
Flash_embedSWF("flash/pop.swf");var mySwf = window.document.sonify;
it works great on a page by itself but as you can see from the snippet below there are no parameters for me to address any other calls from the menu
Code:
/// tech
addmenu(menu=["tech",,,200,1,,style1,0,"left",effect,0,,,,,,,,,,,
," Amber GyroBall","ambergyro.html",,,1
," Blue GyroBall","bluegyro.html",,,1
," DynaFlex Dynamo Gyro","dynamo.html",,,1
," DynaBee Super Gyro","supergyro.html",,,1
," Gel Shoulder Strap","shoulder.html",,,1
," Gel Handle Strap","handle.html",,,1
," PowerDock [Electric Starter]","dock.html",,,1
," Pro Plus Gyro","proplus.html",,,1
," Pro Gyro","progyro.html",,,1
," Speedmeter","meter.html",,,1
," Theragrip Sports Gyro","sportsgyro.html",,,1
])
so... bear with me... is there a way to have the onmouseover="mySwf.Play(); return false" function activate from ANY href rollover using css ( something like a:active { do_funtion(); }?? or a.something?
I'm not THAT good at css -- Thanks
.