Skip to main content
September 5, 2013
Question

Stop background music when go to another scene

  • September 5, 2013
  • 1 reply
  • 4105 views

Im using this code as my background music,i want to stop the music when i leave current scene. What should i add to make it stop when i go to next scene.

import flash.media.Sound;

import flash.net.URLRequest;

import flash.media.SoundChannel;

var music2:Sound = new Sound(new URLRequest("audio/bgmusic2.mp3"));

var sc2:SoundChannel;

sc2= music2.play();

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
September 5, 2013

apply

sc2.stop();

when you go to another scene.