Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Stop background music when go to another scene

Guest
Sep 05, 2013 Sep 05, 2013

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();

TOPICS
ActionScript
4.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 05, 2013 Sep 05, 2013
LATEST

apply

sc2.stop();

when you go to another scene.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines