Help - Search - Members - Calendar
Full Version: Play sound on mouse move
Pixel2Life Forum > Help Section > Adobe Flash
porgeet
Hey all,

I'm doing a web banner, and I need a sound to play when the cursor is activly moving over the banner. And when the cursor stops moving, I want the sound to stop playing, untill the cursor moves again.

A real life example would be scraping fingers down a blackboard. Makes a sound when moving, doesn't when still.

Also I'd like the audio track to continuously loop if the cursor continually moves.

Any ideas, snippets of code that might help would be great. I'm close, but no cigar just yet.

Thanks

porgeet
porgeet
Bump!

Don't want to be an ass guys, sorry. I could REALLY do with some help on this one

Thanks
curthard89
if your using as3 add a listener to the stage mouse move event

CODE
stage.addEventListener(MouseEvent.MOUSE_MOVE,playAudio);

function playAudio( e:MouseEvent ):void {
// tell your net stream to continue playing, google for playing audio in flash and seeking
}


im not seeing whats so difficult, another thing to bear in mind is if this banner is going on any "commercial" site or whatever then sound will have to be turned of by default and have a toggle button.

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.