Skip to main content
October 20, 2008
Question

audio from Flash CS3 Video overlapping

  • October 20, 2008
  • 14 replies
  • 2866 views
audio from Flash CS3 Video overlapping

help stopping the FLVPlayback instance (which has an instance name of theVideo) when another button is clicked!

How do I stop flv playback when user clicks a navigation button ...



Excuse me in advance for asking about a topic that may be very popular!

I'm using the attached code to go from the main stage to one subset of .swf files (loaded movies) and I apparently have no problems with overlapping. Hell, the files even seem to unload themselves correctly. Then, when I go to my second subset of .swf files (with the exact same AS3 structure), which has a Flash Video file (made by the FLV Playback component), I get into an overlapping problem associated with the audio.

How can I stop, cancel, or unload the audio when the file is clicked away from (the user selects another button on the main stage)?

Code attached. Please let me know if anything else is needed.

Yours Sincerely,

Jntspecialty
This topic has been closed for replies.

14 replies

kglad
Community Expert
Community Expert
October 27, 2008
that "code" has so many problems i don't think i'm going to be able to help you any further without looking at your fla and correcting it and i don't do that unless i'm hired to help.

if you have any specific questions, i will continue to answer those in this forum, but i have no idea what you're trying to do with that code you just posted.
Participant
March 26, 2009
Hey,

You might have figured this out by now but all you need to do is add: SoundMixer.stopAll(); as part of the function for your btn actions... ie:

videopage_btn.addEventListener(MouseEvent.CLICK, videopage);
function videopage(event:MouseEvent):void
{
SoundMixer.stopAll();
ldr.load(videopageReq);

}



Add that to all your buttons and audio overlap will never happen...

Cheers!
kglad
Community Expert
Community Expert
October 24, 2008
if theVideo is on the main timeline in videopage.swf, you can use:

MovieClip(ldr.content).theVideo

to reference your flvplayback instance AFTER theVideo is instantiated (ie, the frame that contains theVideo has rendered).
October 25, 2008
I have tried to clean up code and do this right.

I need help referencing (storing the value in the variable "stopsoundoverlapReq") the "flvplayback instance AFTER theVideo is instantiated (ie, the frame that contains theVideo has rendered)" correctly.

Also, now I need help with the name of my nav bar button's method followed by parentheses, which should include the appropriate method parameter.



On my main timeline, I tried to clean up the code and use:

var stopsoundoverlapReq:FLVPlayback = stop("videopage.swf/MovieClip(ldr.content).theVideo");


Then for my nav bar button on this same timeline use:

any_btn.addEventListener(MouseEvent.CLICK, stopsoundoverlap);
function stopsoundoverlap(event:MouseEvent):void
{
stopsoundoverlap.stop(stopsoundoverlapReq);
}


The 3 errors I get now are :

1046: Type was not found or was not a compile-time constant: FLVPlayback. var stopsoundoverlapReq:FLVPlayback = stop("videopage.swf/MovieClip(ldr.content).theVideo");

1061: Call to a possibly undefined method stop through a reference with static type Function. stopsoundoverlap.stop(stopsoundoverlapReq);

1137: Incorrect number of arguments. Expected no more than 0. var stopsoundoverlapReq:FLVPlayback = stop("videopage.swf/MovieClip(ldr.content).theVideo");
kglad
Community Expert
Community Expert
October 24, 2008
theVideo is in videopage.swf that's loaded by ldr and theVideo is in a movieclip named videopageReq?
October 24, 2008
No, theVideo is the instance name of the FLV Player component in the videopage.swf that's loaded by ldr.

There is no movie clip.

videopage_Req is the variable for the button that goes to videopage.swf and ultimately plays and just only has the Flash Video, which is "theVideo".

So, ldr loads different variables (.swf files) accordingly.
kglad
Community Expert
Community Expert
October 24, 2008
theVideo is not in the swf that loads into your main swf?
October 24, 2008
YES, the Flash CS3 video ("theVideo") IS indeed playing in the .swf (videopage.swf/videopage_Req), that loads into your main swf.

But, when I navigate away, all my other file requests display over the visual aspects of videopage.swf/videopage_Req ONLY.
kglad
Community Expert
Community Expert
October 23, 2008
what's your loader's name? what is the flvplayback's name and what is its relationship to the main timeline in that external swf?
October 24, 2008
The loader name is "ldr". The Flashback's name is "theVideo". The relationship of the "theVideo" to the main time line is that it plays from a loaded file named (videopage.swf/var videopageReq), which is loaded from a file named (gallerypage.swf/var gallerypageReq), which is accessed from a navigation bar button (gallerypage_btn), which is on frame 2 of the main timeline.

The videopage.swf, which has the Flash CS3 Video name "theVideo", plays on the top level of the main timeline, at a fixed x/y location.

THEN, when another button on navigation bar is clicked, to give the vision of another file replacing videopage.swf, the other .swf files do indeed replace videopage.swf visually, BUT not audioly.
kglad
Community Expert
Community Expert
October 22, 2008
if you playback component is in a loaded swf, you need to reference it after loading is complete and the component has initialized (which may not be occur immediately after your component appears on stage.)

and you need to use the correct path to reference it. the main timeline of the loaded swf can be referened (again, after loading is complete) by casting your loader's content property as a movieclip. you'll then need to use the path (in your loaded swf) to your component.
October 22, 2008
OK. So, it sounds like I need to stop a .swf file (or a loaded .swf, what ever would be the appropriate phrase), the button to the FLVPlayer Component/Flash Video, and the FLVPlayer component, right?


Again, any examples of what you think I can try with the code structure we've been talking about from above are welcome.


It sounds like this is not just stop a variabe/var.


From the main stage (mainstage.swf), how would I maybe use "stop();" for this "mainstage.swf/gallerypagemuv.swf/videeopage.swf/Flash Video (with an instance name of "theVideo")" (which is loaded)?

***** Please comment on my broad imagination of how I think I could make this work (below)!

var flvPlay:FLVPlayback();

thumbnailpage_btn.addEventListener(MouseEvent.MOUSE_DOWN, stopFLV);

function stopFLV(event:MouseEvent):void{
(MAIN.swf/videopage_btn/videopage.swf/theVideo).stop(flvPlay);
}
October 23, 2008
I have tried a lot and I still don't get it.

I am still determined to get this taken care of.

What now?
kglad
Community Expert
Community Expert
October 21, 2008
theVideo should be the instance name of your flvplayback component and stopFLV() should be call by any button that navigates AWAY from the frame that contains your flvplayback component.
October 21, 2008
Okay, I understand a little bit better, but I am still having a difficult time.

I believe I need help setting up a variable.

Please consult me on your opinion on something maybe like:


var flvPlay:FLVPlayback();

thumbnailpage_btn.addEventListener(MouseEvent.MOUSE_DOWN, stopFLV);

function stopFLV(event:MouseEvent):void{
theVideo.stop(flvPlay);
}

However, when I tried this I got an error

"1046: Type was not found or was not a compile-time constant: FLVPlayback." var flvPlay:FLVPlayback();


I am still open to and trying to get help for this.
October 22, 2008
I am posting this to update and inform you.

I am still open to suggestions for writing a compiliable variable and function (or any WORKAROUND) for my FLV Playback component (which has an instance name of "theVideo" and is in a external .swf to be loaded) to stop this audio overlapping situation.

Imagine what a good feeling it would be to be helpful.

Yours Sincerely,

Jntspecialty
kglad
Community Expert
Community Expert
October 20, 2008
:

thumbnailpage_btn.addEventListener(MouseEvent.MOUSE_DOWN, stopFLV);

function stopFLV(e:Event){
yourflvpb.stop();
}
October 20, 2008
What is yourflvpb? Do you mean the instance name (which is "theVideo") from the .swf file that contains the FLV Playback component?

I tried

"thumbnailpage_btn.addEventListener(MouseEvent.MOUSE_DOWN, stopFLV);

function stopFLV(e:Event){
theVideo.stop();
} "

on my simple nav page. Now, I get an error message saying " 1120: Access of undefined property theVideo."
October 20, 2008
I did some research and I don't understand.

Any examples of what you think I can try are welcome.
October 20, 2008
I did some research and I don't understand.

Any examples of what you think I can try are welcome.