3 Replies Latest reply on Jan 26, 2007 3:11 PM by kglad

    Making another mc change with mysound.onload event handler

    Jonibean Level 1
      I have two little music players on my site, let's say 'main' and 'discography'. 'Main' starts automatically, and the other is in the discography section and has buttons that have to be clicked. When someone plays a song in the discography section, I want the main music player to go to another frame, on which there is no music and the spinning graphic showing that it is playing is not there anymore.

      I am using the sound handler thing, so I'm trying to use mySound.onLoad event handler to make this happen. I've used the onSoundComplete to make the 'discography' movie clip go back to it's first frame, where there is no music playing. But this code doesn't seem to be working. I am fairly new at this - maybe I am targeting the other movie clip wrong? I didn't want to keep adding the same code into every play button, so I thought this would work.

      This code is in my 'discography' movie clip, first frame. My 'main' movie clip is on the main timeline. "TopMusicMenu' is the instance name of my 'main' movie clip. Is this correct, or am I going about it the wrong way?

      this.createEmptyMovieClip ("mcSoundHolder", this.getNextHighestDepth());
      var mySound:Sound = new Sound (mcSoundHolder);

      mySound.onLoad = function() {
      this._parent.TopMusicMenu.gotoAndStop("nomusic");
      //get the top music player to go back to beginning
      }

      //buttons for music
      btn_chambre1.onRelease = function():Void {
      stopAllSounds();
      mySound.loadSound("MusicdeChambre4_IntroAllegro.mp3", true);
      gotoAndPlay("Chambre1");
      }

      etc. (there are several of these buttons)

      Thanks for any help.