Jump to content


Photo

Play sound on mouse move


  • Please log in to reply
2 replies to this topic

#1 porgeet

porgeet

    Young Padawan

  • Members
  • Pip
  • 9 posts
  • Gender:Male

Posted 26 February 2009 - 01:17 PM

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

#2 porgeet

porgeet

    Young Padawan

  • Members
  • Pip
  • 9 posts
  • Gender:Male

Posted 01 March 2009 - 11:56 AM

Bump!

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

Thanks

#3 curthard89

curthard89

    Young Padawan

  • Members
  • Pip
  • 226 posts

Posted 02 March 2009 - 04:23 AM

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

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users