# So I wanted to animate sound controls

**URL:** <https://forum.kirupa.com/t/so-i-wanted-to-animate-sound-controls/194206>\
**Category:** flash\
**Created:** [July 21, 2006, 9:57am UTC](https://forum.kirupa.com/t/so-i-wanted-to-animate-sound-controls/194206 "2006-07-21T09:57:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Multi\_Task](https://avatars.discourse-cdn.com/v4/letter/m/c6cbf5/32.png) [@Multi\_Task](https://forum.kirupa.com/u/Multi_Task)\
**Post date:** [July 21, 2006, 9:57am UTC](https://forum.kirupa.com/t/so-i-wanted-to-animate-sound-controls/194206/1 "2006-07-21T09:57:38Z")

</div>

I have tried this about 24 different ways now.

Within main movie there lies a movie clip called soundcontrols\_mc. Within this i am creating a emptyMovieClip via actionscript seen below:

```auto

 
 _root.createEmptyMovieClip("sound_mc", 1);
 _root.sound_mc.sound_obj = new Sound();
 _global.song_nr = random(songfile.length);
 _root.sound_mc.songStarter(songfile[song_nr], songname[song_nr]);
 

```

Now to control this sound I have made buttons. I wanted to animate these buttons so within soundcontrols\_mc I have created another movie clip called pt\_mc which holds these buttons. Now onto the question:  
The action script I am using to control the sound\_mc is:

```auto

btn_play.onRelease = function() {
 this._root.sound_mc.songStarter(songfile[song_nr], songname[song_nr]);
};
btn_stop.onRelease = function() {
 this._root.sound_mc.sound_obj.stop();
};
btn_next.onRelease = function() {
 (song_nr == songfile.length-1) ? _global.song_nr=0 : _global.song_nr++;
 _root.sound_mc.songStarter(songfile[song_nr], songname[song_nr]);
};
btn_prev.onRelease = function() {
 (song_nr == 0) ? _global.song_nr=songfile.length-1 : _global.song_nr--;
 _root.sound_mc.songStarter(songfile[song_nr], songname[song_nr]);
};
 

```

Now all this code lies within soundcontrols\_mc and I have tried rewritting it many ways for navigational control and also placing it within the pt\_mc but when I do that all songs restart everytime animation happens. So if your still with me any ideas?

Things I have tried (just started learning action script from AS, The definitive Guide).  
So I have altered \_parent, \_root swapping all types and degrees of them and cant get a response from my handlers.

Layout of Movie-

Index.swf-  
soundcontrols\_mc-  
creation of sound\_mc (via AS)  
pt\_mc  
buttons for control of sound\_mc

Thanks for any ideas.  
MT
