How can I remove a child swf and stop all sounds when parent closes?

Hi All,
I am new to actionscript 3 and trying to learn as I go. The problem I am having is the following:
I have a carousel of images that load an external swf movie with a FLVPlayback component on it. The problem is that when the external swf unloads the sound of the FLVPlayback component continues to play. I am using a carousel component I found online to load the images and each image loads an external swf file. here is the code for it.
import com.carousel.DegreeCarousel;
import com.carousel.data.CarouselDO;
import com.carousel.data.AngleDO;
import com.carousel.data.ItemDO;
// DEFINING THE CAROUSEL OBJECT
var carouselSettings:CarouselDO = new CarouselDO();
carouselSettings.radiusX = 300;
carouselSettings.radiusY = 0;
carouselSettings.fov = 50;
carouselSettings.transitionTime = 1;
carouselSettings.ease = "easeInOutQuint";
carouselSettings.useToolTip = 0;
carouselSettings.useBlur = 1;
carouselSettings.maxBlur = 8;
carouselSettings.reflectionAlpha = 0.2;
// DEFINING ANGLES SETTINGS
var angleSettings_arr:Array = new Array();
angleSettings_arr[0] = new AngleDO({angle:0,alpha:1,scale:0.5});
angleSettings_arr[1] = new AngleDO({angle:90,alpha:1,scale:1});
angleSettings_arr[2] = new AngleDO({angle:180,alpha:1,scale:0.5});
// DEFINING THE ITEMS
var prefix = "content/thumbs/"
var galleryItems:Array = new Array();
galleryItems[0] = new ItemDO({thumb:prefix + "image_1.jpg", content:prefix + "swf1.swf", contentType: "flash"});
galleryItems[1] = new ItemDO({thumb:prefix + "image_2.jpg", content:prefix + "swf1.swf", contentType: "flash"});
galleryItems[2] = new ItemDO({thumb:prefix + "image_3.jpg", content:prefix + "swf1.swf", contentType: "flash"});
// PLACING THE CAROUSEL TO STAGE
var carousel:DegreeCarousel = new DegreeCarousel(carouselSettings,angleSettings_arr,galleryItems);
carousel.x = stage.stageWidth * .5;
carousel.y = stage.stageHeight * .5;
this.addChild(carousel);   
// KEYBOARD NAVIGATION
// KEYBOARD EVENTS
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);   
function keyDownHandler(e:KeyboardEvent):void
    // left
    if(e.keyCode == 37)
        carousel.left(1);
    // right
    if(e.keyCode == 39)
        carousel.right(1);
    // top
    if(e.keyCode == 38)
        carousel.prevCycle();
    // Down
    if(e.keyCode == 40)
        carousel.nextCycle();
    // Space
    if(e.keyCode == 32)
The external movie loads fine. Then the external swf calls for a second swf containing a video. This is the code that is used to load the swf:
import flash.net.URLRequest;
import flash.display.Loader;
import flash.events.Event;
import flash.display.MovieClip;
import flash.events.MouseEvent;
var myVideo:URLRequest = new URLRequest("myvideo.swf");
var video:Loader = new Loader();
video.load(myVideo);
this.addChild(video);
When the carousel unloads, it unloads both movies but the sound keeps on playing.
Is there any way to stop the sound from keep playing?
Thank you very much!!
-M

You want to stop the audio from playing and also downloading more video/audio if it is still downloading when you go to a new keyframe where the video display/component or mp3 player is removed from the stage because it's keyframe ended or do not exist anymore but you still hear the audio.
Add an event listener to your video playback component that calls a function when the flash player tries to remove the video plaer from the stage that stops the netstream or at least stops/pauses the video playback.
[link removed]
//sample NetConnection and NetStream classes when the video player is removed from the stage tell the NetStream to stop playing or downloading the content with .close();
var connection:NetConnection = new NetConnection();
connection.connect(null);
var stream:NetStream = new NetStream(connection);
addEventListener(Event.REMOVED_FROM_STAGE, videoRemovedFromStage);
function videoRemovedFromStage(e:Event){
   stream.close();

Similar Messages

  • How can I unregister an old number and stop using it when I imessage or use Facetime?

    Hello!
    I just got a new iPhone and an old number appeared on the list of addresses that can be used while on iMessage or Facetime. How can i unregister it?
    Thanks for the help!

    Hi there WebTee,
    You may find the information in the article below helpful.
    iOS and OS X: Link your phone number and Apple ID for use with FaceTime and iMessage
    http://support.apple.com/kb/HT5538
    Unlink a phone number
    To remove a phone number from an Apple ID, sign out of FaceTime and Messages on your iPhone:
    Settings > Messages > Send & Receive. Tap your Apple ID, then tap Sign Out.
    Settings > FaceTime. Tap your Apple ID, then tap Sign Out.
    This should remove your phone number from other devices using the same Apple ID with FaceTime and Messages. If the phone number is still available on other devices after you sign out of FaceTime and iMessage on the iPhone, you may need to sign out of iMessage and FaceTime on all your devices, then sign in to FaceTime and Messages again on devices you want to use.
    Note: If you no longer have access to the iPhone that is using the number you want to remove, reset your Apple ID password.
    -Griff W.

  • How can i block stolen iphone 4 and stop all of its functionalities?

    I lost my IPHONE 4 just few hours ago. I dont know how block all of its functionalities so no one can use it. I have the application of "Find My Iphone" turned on but I dont know how to use it. I dont even know my IMEI or Serial number. I am asking how can I retrieve it from my iCloud Account.
    For those who could help me you can contact me at my Email account:
    <Email Edited by Host>
    Thanks!
    Khen22

    First, it's a really bad idea to put your email address in a post to a public forum where millons of people, including some who have less than stellar ethics, will see it. At the least you will now be on thousands of spammer lists.
    Log in to your account using your Apple ID and password at https://www.icloud.com and click "Find my iPhone".

  • A friend gave me her VAIO laptop.How can I remove her ITUNES library and use mine which I want to sync with my Ipad and Iphone?

    A Friend gave me her VAIO laptop.How can I remove her ITUNES library and use my library.  Want to sync my Ipad and Iphone to My library.

    I believe when you plug her old iPhone in to your computer it will notify you that the phone is synced with another library and ask if you want to register it with your library.  At least this is how iPods work.  I'm not sure about iPhones.  If you want to actually use the phone as your own you may need to go through AT&T.
    If you're just looking to use the iPhone as an iPod (without the phone portion of it) you may run in to some problems.  The iPhone really wants to be on a cell network all the time.  I think you'd have to jailbreak it to get it to work properly as an iPod.
    Let us know what happens when you plug the phone in to your computer.

  • HT1386 how can i remove the itunes logo and go back to the home screen

    how can i remove the itunes logo and go back to the home screenv

    If by "iTunes logo" you mean the image below, you need to connect your phone to iTunes and follow that directions that appear (which will probably tell you that you need to restore your phone).

  • How can i remove the bar (where i search for websites) when i full screen for my macbook pro

    how can i remove the bar (where i search for websites) when i full screen

    ohhh k i got it but thats not what i am looking for, so when i full screen i want it to be like fully full screen like when i watch a movie i want nothing but the movie on the screen and when i bring the mouse up then the tab shows again thats what exactly I'm asking about.

  • How can I get iTunes to locate and play all my music files?

    How can I get iTunes to locate and play all my music files?

    I have this problem too. I am researching now. Here is what I know so far. If you right click a song then get ifo the it will say Protected AAC or purchased AAC. Protected wont play on sonos, purchased will play on sonos. It seems that all my protected were purchased 2005 to 2009 or so. I am trying to find out if apply will convert these for a small dfee or if I use the itunes cloud these tunes will convert for me. downloading and reloading is not an option for me. Pretty much a money grab by apple either way. I am sure Steve is smiling.

  • How can i open the directory/​folder and read all the files inside it in order and then close it?

    How can i open the directory/folder and read all the files inside it in order and then close it? any example would be nice.
    thanks

    In the File I/O>>Advanced File Functions Palette is a function named "List directory". This function will give you two arrays. One contains the names of all subdirectories the other the names of all files. If you want to sort them by name use the array sort function. If you want to sort them by another attribute use the File/Directory Info function to get more data. Use a cluster which contains the attribut to sort and the original index of the name. Then sort this array.
    Waldemar
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

  • How can I make a calender entry that makes a sound when it is its turn?

    How can I make a calender entry that makes a sound when it is its turn?

    Have you even looked at the calendar app? Did you not notice the "Alert" field in the event details when you create a calendar event?

  • How can I remove u0091*u0092 s and display the amount

    My coding
    T1  TOTAL,,,,,,&REGUD-SWABZ&    &REGUD-SWNES&
    Doubt :
    REGUD-SWNES is the value coming from structure REGUD,
    But the value is coming as **********70.250,92
    But I need to display as 70.250,92
    How can I remove ‘*’ s and display the amount ?

    Not sure why it is coming like that.   Is the field length big enough? 
    I guess, you could try....
    translate REGUD-SWNES using '* '.
    condense REGUD-SWNES no-gaps.
    But again, I have no clue as to why you are seeing this.
    Regards,
    Rich Heilman

  • How can i remove items from list that have been deleted when i click on them it keeps showing empty

    how can i remove items from the list that have been deleted when i click on them it keeps showing folder empty

    Actually, Reader SHOULD keep showing documents that no longer exist, I disagree. It's no big deal, and people will quickly realise why they can't open the file. They open more files, the old ones move off.
    The REASON why it should not check is that checking whether a file exists can take a long time when things aren't good. For instance if a file server goes down, or a memory card is unplugged. That in turn would mean delays opening the File menu, and I've seen some software that can sit there for several minutes. That would really give people something of which to complain...

  • HOW CAN I REMOVE "ASK" SEARCH BAR AND GET BACK FIREFOX SEARCH BAR?

    for last few dyas, when i click on firefox icon, i get the "ASK" search bar. i want to remove 'ASK' search bar, and get back firefox search bar

    If this is the Ask.com toolbar, you can remove it by following these instructions: '''[http://about.ask.com/apn/toolbar/docs/default/faq/en/ff/index.html#na4 How do I uninstall the Toolbar?]'''
    You may also be able to '''[[Uninstalling add-ons|disable or uninstall the add-on using the Firefox add-on manager]]'''.

  • Since updating to Firefox 4.0.1 I have lost the Easy Edit button on my Wetpaint Wiki. How can I remove 4.0.1 and return to previous verison?

    The Wetpaint Wiki worked well with previous version of Firefox but doesn't work now. I can load wiki but it appears different to normal and the Easy Edit button no longer exists. I want to get rid of the new Firefox and go back to old one. How can I do this please?

    http://community.norton.com/t5/Norton-Internet-Security-Norton/Norton-Toolbar-not-compatible-with-FF-4-0-1/td-p/442788

  • How can I remove an Apple ID and start a new ID ?

    In my iMac (software up to date OSX 10.9.4) I need to remove the apple ID and start afresh with a new ID.
    How to do this?

    https://appleid.apple.com/

  • How can I remove the thin black border of Flash movie when viewed in a browser?

    There is a thin border at the top and left margins of my Flash movie when the .html is viewed in a browser. How can it be removed?
    Here's the movie.
    One solution suggests replacing some code, but the code they suggest replacing doesn't even exist in my html file.
    I have found questions similar to mine being asked all over different forums, but their solutions either don't work, or like the above, don't really apply. For such a common problem, finding the solution is getting a little frustrating.
    I'm using Flash CS3 on a Windows PC rrunning XP professional.

    Okay, I found the answer. It turns out that when I made the buttons in Flash (so the movie would have clickable links), the default stroke color was set to black. Change it to white and the outline is gone.
    As for appearing only on the top and left of the movie - for some reason the bottom and right is being cropped a bit when it's placed in to the html page. But that's a topic for a different discussion.

Maybe you are looking for