Skip to main content
Participating Frequently
May 3, 2011
Answered

Problem: Turn on Audio for external flv on replay when previously muted while playing (CS5 AS2)

  • May 3, 2011
  • 1 reply
  • 1331 views

I have a project where an external video plays with cue points that  trigger the elements on my main timeline (captions). I have a custom mute button  for the video so that the guy talking on the video can be muted if necessary (did not use a skin for video controls but set it up as a button). The problem is, when I reach the end of the video and I click  a "replay" button to restart at the beginning, the timeline and video start but if the video was muted previously, the video remains muted while my button shows that it isn't. How do I  get the audio to turn back on automatically when restarted, or at a minimum show that it's still muted when replaying?

My replay button AS2. mcPlayer is my flv.

Actionscript Code:
on(press) {
    _parent.mcPlayer.seekToNavCuePoint("pict1");
    mcPlayer.play();
}

The mute button wasn't set up by me (inherited this project) so I'm not sure how it works but it's a movie clip named "audio" with one point at

Actionscript Code:
on (release) {
    i = -100;
    s = new Sound(_parent);
    s.setVolume(0);
    gotoAndStop("reset");
}

and the other at

Actionscript Code:
on (release) {
    i = -100;
    s = new Sound(_parent);
    s.setVolume(100);
    gotoAndStop("hold");
}

I just want it reset to 100 when the video starts, whether on or off. What do I need to add to my replay button to make this happen? I've been doing trial and error and nothing's working! Thanks.

This topic has been closed for replies.
Correct answer kglad

use:

kglad wrote:

if all your buttons are attached to the same parent:


on(press) {
  s = new Sound(this);
    s.setVolume(100);

    _parent.mcPlayer.seekToNavCuePoint("pict1");
    mcPlayer.play();
}


on (release) {
    i = -100;
    s = new Sound(_parent);
    s.setVolume(0);
    gotoAndStop("reset");
}


on (release) {
    i = -100;
    s = new Sound(_parent);
    s.setVolume(100);
    gotoAndStop("hold");
}

1 reply

kglad
Community Expert
Community Expert
May 3, 2011

if all your buttons are attached to the same parent:


on(press) {
  s = new Sound(_parent);
    s.setVolume(100);

    _parent.mcPlayer.seekToNavCuePoint("pict1");
    mcPlayer.play();
}


on (release) {
    i = -100;
    s = new Sound(_parent);
    s.setVolume(0);
    gotoAndStop("reset");
}


on (release) {
    i = -100;
    s = new Sound(_parent);
    s.setVolume(100);
    gotoAndStop("hold");
}

yavynAuthor
Participating Frequently
May 4, 2011

That didn't work to get the audio to start playing. Does it matter that the mute button commands are inside a movie called "audio"? I tried variations like putting audio.s.setVolume(100); but that didn't work either.

Any other ideas? Thanks!

kglad
Community Expert
Community Expert
May 4, 2011

yes, it matters.  that's why i stated, "if all your buttons are attached to the same parent:"

add trace(this) to all 3 buttons and paste the output and which buttons correspond to each output.

also, i'll need to know if any buttons are movieclip buttons.