1

Greeting,

I have problem stopping FLVPlaypack component when I navigate from one frame to another frame that the play which has instance name (vi) still working in back ground. when the flash loaded I used vi.stop() to stop the play also I added same line to each function that would be called when a button clicked but when I click any button the sound still playing in the background and when I click on the button(b1) which navigate to frame 1 which has the player, the player would be stopped but the sound is still playing.

Please help me to solve this problem. all what I want is to stop the player when I navigate to another frame.

here is my code:

stop();
vi.stop();
b1.addEventListener(MouseEvent.CLICK, bt1);
b2.addEventListener(MouseEvent.CLICK, bt2);
b3.addEventListener(MouseEvent.CLICK, bt3);

function bt1(evt:MouseEvent) {
    gotoAndStop(1);
    vi.stop();
}
function bt2(evt:MouseEvent) {
    gotoAndStop(2);
    vi.stop();
}
function bt3(evt:MouseEvent) {
    gotoAndStop(3);
    vi.stop();
}
Eyla
  • 5,751
  • 20
  • 71
  • 116

2 Answers2

4

call "vi.stop();" before navigating to a new frame

Here's what the code should look like:

stop();
vi.stop();
b1.addEventListener(MouseEvent.CLICK, bt1);
b2.addEventListener(MouseEvent.CLICK, bt2);
b3.addEventListener(MouseEvent.CLICK, bt3);

function bt1(evt:MouseEvent) {
    vi.stop();
    gotoAndStop(1);
}
function bt2(evt:MouseEvent) {
    vi.stop();
    gotoAndStop(2);
}
function bt3(evt:MouseEvent) {
    vi.stop();
    gotoAndStop(3);
}

Once you navigate to a new frame you are losing the reference to the vi FLVPlayback object.

Jordan
  • 1,233
  • 2
  • 12
  • 32
  • Thank you for your help I think that I got the idea but if my player object is in a different frame than the frame hold the code how can I access the object?? – Eyla Feb 16 '11 at 02:23
  • @Eyla To keep a reference put the player on its own layer and have the frame containing the player span whatever frames you need to reference it from. – Jordan Feb 16 '11 at 02:33
1

For each frame that the user navigates to just add SoundMixer.stopAll();

Shantha Kumara
  • 3,272
  • 4
  • 40
  • 52