Pixel2Life Forum: Play sound on mouse move - Adobe Flash - Pixel2Life Forum

Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Play sound on mouse move Play part of an audio track while the cursor moves, stop when still

Array

#1 User is offline   porgeet 

  • Young Padawan
  • Pip
  • Group: Members
  • posts 9
  • Joined: 22-June 06
  • 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
0

#2 User is offline   porgeet 

  • Young Padawan
  • Pip
  • Group: Members
  • posts 9
  • Joined: 22-June 06
  • 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
0

#3 User is offline   curthard89 

  • Young Padawan
  • Pip
  • Group: Members
  • posts 226
  • Joined: 25-July 06

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

Share this topic:


  • You cannot start a new topic
  • You cannot reply to this topic

0 user(s) are reading this topic
members, guests, anonymous users