Jump to content


Sound and mulitple VideoLoaders

Recommended Posts

Thank you in advance. Great VideoLoader, love its features.

I am having a sound issue though.

I have three MCs in my FLA linked to the Main document.

I load each video player into a dummy container on a mouse click event and am able to remove the content from the container. However, the sound keeps playing.

I tried creating a dummy function with the Main class to pauseVideo but it comes back as undefined. i can trace (myMC.showVideo and return the fact that it is a function function {} so i know i can get into the class.)

So, simply how would i stop the sound using multiple loaders within the same project? Thank you.

Link to comment
Share on other sites

yes, removing a VideoLoader from the display list does not stop it from playing.


when you remove the video from the container try:



Link to comment
Share on other sites

ok. i will get that a shot today. thanks!

Link to comment
Share on other sites

no. that didnt work i get undefined property error returned.....




var container:MovieClip = new MovieClip();

var currentPage:String = new String();

var twoDVid:video2DMC;

var threeDVid:video3DMC;

var testVid:testVidMC;


twoDMovies_btn.buttonMode = true;

threeDMovies_btn.buttonMode = true;

testAnimations_btn.buttonMode = true;


twoDMovies_btn.addEventListener(MouseEvent.CLICK, goMovies);

threeDMovies_btn.addEventListener(MouseEvent.CLICK, goMovies);

testAnimations_btn.addEventListener(MouseEvent.CLICK, goMovies);


function removeMovies(e:MouseEvent)




case twoDMovies_btn:



var twoDVid = new video2DMC();

twoDVid.name = "TwoD";

currentPage = twoDVid.name;


container.addChild (twoDVid);

twoDVid.x = 134.65;

twoDVid.y = 59.6;


trace ("ok" );


case threeDMovies_btn:


var threeDVid= new video3DMC();

threeDVid.name = "ThreeD";

currentPage = threeDVid.name;


container.addChild (threeDVid);

threeDVid.x = 134.65;

threeDVid.y = 59.6;

trace("before pause")


trace("after pause")


case testAnimations_btn:


var testVid = new testVidMC();

testVid.name = "Test";

currentPage = testVid.name;


container.addChild (testVid);

testVid.x = 134.65;

testVid.y = 59.6;




// if (container.twoDVid)

// {

// twoDVid.stopCurrentVideo();

// trace("ok")

// }

// else if (threeDVid)

// {

// threeDVid.stopCurrentVideo();

// }

// else (testVid)

// {

// testVid.stopCurrentVideo();

// }


function removeModules ()


while (container.numChildren)


container.removeChildAt (0);

trace(container.numChildren + "this sucks")






this is my code. i am aware that i'll need to do checks if someone is bouncing back and forth between sections, right now i'm just trying to get the sound to stop once. :) thank you

Link to comment
Share on other sites

Thanks for the code. I can only suspect that you aren't targeting the VideoLoaders properly. From the code provided I have no idea what stopCurrentVideo() or pauseVideo() do. Are those methods in your custom classes video2DMC video3DMC, and testVidMC?


pauseVideo() is a method of the VideoLoader, and it appears that you are using it on twoDvid and other instances of your custom classes. Can you provide the code that you use to create your VideoLoaders and explain where that is happening? if I can see how the VideoLoaders are referenced I can much better assist in figuring out why they aren't working.


Do you have a way of confirming that the videos stop playing but there sound doesn't when pauseVideo() is called? For instance have you tried not removing the VideoLoaders from the display list and calling pauseVideo() on them?


In the short term I would suggest getting away from controlling 3 videos. Make a file where 1 video loads and create a button that pauses the video (which will also pause the sound). Once you know how pauseVideo() works, you will have a better understanding of how to make it work in this more robust multi-video controller.


From what I can tell, the logic you set up looks pretty good. I think once you target the loaders it will all fall into place.

Link to comment
Share on other sites

Thanks Carl. So, I currently have one player that works with a play/pause button (www.davidjopperman.com in the theatre section. And within that I can confirm that the video and the sound both get paused.


stopCurrentVideo was a public function I set up within the custom class to make sure I could access that class. (it had a simple trace statement in it)


pauseVideo was based off of your suggestion. (unless i defined pauseVideo as a function because I added parathesis at the end ??? )


my custom class for video2DMC video3DMC, and testVidMC are the essentially they same they will just target different xml files. (I'm trying to break the player into sections basically one for 2D, 3D and testAnimations).

Link to comment
Share on other sites

Cool. Thanks for the clarification, That all makes sense.


Let me know if you need further assistance targeting and pausing each class's VideoLoader. It sounds like you have a solid system in place.



Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.