flash cs5 v11, as3
hi, i'm a photographer without any scripting knowlage trying to get some actionscript 3 running. i want to do many little animations with sound on one page. for not getting a complete sound mess i thought about playing only on hoover. i was lucky to mix up some as3 to get a sound playing only when you hover the animation.
A invisible button on a layer above the movie frames controls via mouseover and mouseout the start and stop of the sound - problem here: sound runs totally uncontrolled and asynchronous to the frames of the animation.
the animation: http://bit.ly/mc7uRu
fla file: http://bit.ly/kyIxP1
a screenshot: http://bit.ly/lLxc8q
here is the code of the button:
PHP Code:
import flash.net.URLRequest;
import flash.media.SoundChannel;
newButton.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
newButton.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
var snd = new Sound();
var chn = new SoundChannel();
snd.load(new URLRequest("http://...filename.mp3"));
function mouseOverHandler($e:MouseEvent):void
{
this.chn = snd.play(0,10);
}
function mouseOutHandler($e:MouseEvent):void
{
SoundMixer.stopAll();
}
now i loaded the audio file into the library to put it into timeline to be able to control when the sound starts and ends.
i wanted to set the volume of the movie at start to 0%
at mouseover to 100%
and on mouseout to 0% again ...
but that's the part i seem to be stuck for ever
do you have any quick hints for me??
thank you so much!!
idothings