tags:

views:

43

answers:

1

Objective: Play a sound effect when the user mouses down on the HSlider. Stop or pause the sound when the user mousses up. The following code starts the sound but a mouseup does not stop it.

<mx:SoundEffect id="soundEffectSong" useDuration="false" source="http://www.helpexamples.com/flash/sound/song1.mp3"/&gt;
<mx:Form x="10" y="39" width="454" height="452">
 <mx:FormItem label="Age">
  <mx:HSlider id="ageSlider" allowTrackClick="true" minimum="1" maximum="100" snapInterval="1" liveDragging="true" value="1" mouseDownEffect="{soundEffectSong}" mouseUpEffect="{soundEffectSong.pause()}"/>
 </mx:FormItem>
</mx:Form>
A: 

Have you tried the end() method instead of pause()?

So:

... mouseUpEffect="{soundEffectSong.end()}"/>

Documentation for end() says:

Interrupts an effect that is currently playing, and jumps immediately to the end of the effect.

Tehnomaag
Yes...Tried that as well. Same result. Effect keeps playing.
PDXNative