RemoveChild and Stop all Animation/Sound plz help!!

Hey hope someone can help me out with this, been stuck on this for a while now and tried a number of different way but no luck so far.
Im trying to removechild and at the same time stop all the on going animation and sound, in a way reset them so that if this child is added again it plays like it did the first time.
I've tried these scripts but non work, either i get an error or the sound doesnt stop and the animations stack:
//==================================================
1.
bgFarm.stopImmediatePropagation()
2.
while (bgFarm.numChildren != 0)
bgFarm.removeChildAt(0);
3.
gameMain_Controls.islandBG.removeChild(bgFarm);
===================================================
the bgFarm is added to the main background from another class
thx, hope someone can help
pavel

If all are done in script things are easier but I assume you're using timeline MovieClips. Generally speaking, stop() stops the timeline and removeChild() removes a DisplayObject (such as MovieClip) from a DisplayObjectContainer (such as Sprite and MovieClip). As for the sound, if you manage it by script it's easy to stop a sound with SoundChannel.stop(), but if your sound is on the timeline you have not much control. Either SoundMixer.stopAll() (but this stops ALL the sounds) or set SoundTransform volume to 0.

Similar Messages

  • Play FLV and stop all other webpage sounds

    I have a website that has two flash items on it. I have a swf that calls mp3s that plays on the page load, and I have a FLV that plays on page load.
    What I would like to happen is:
    on page load
    the FLV plays
    when the FLV Finishes
    the swf starts to play the mp3s.
    What already happens is that the pages load in _blank pages so they are in new windows.
    This is good because while you navigate the site, the music from the homepage is still cycling through the swf's mp3 playlist.
    The problem comes in when you navigate back to the homepage from a new window, and the homepage is still open within the first window.
    That means that the video plays over, while the music is playing, and the music doubles up.
    Now the video playing isn't bad, it's that music is doubling up. Can't it sense itself playing a 2nd instance of itself on another webpage and stop it?
    Need big help here. Career is on the line!

    you can explicitly stop each sound that you want to stop or if you want to stop all sounds you can use:
    stopAllSounds();  // as2
    or
    SoundMixer.stopAll();  // as3

  • I have just upgraded to 10.8 on my macbook pro and now I can't access itunes, videos and there is no sound - anyone help?

    I have just upgraded to 10.8 on my macbook pro and now I can't access itunes, videos and there is no sound - anyone help?
    It is an old macbook pro probably 6yo with the back lit keys - not under applecare anymore obviously. I downloaded the upgrade last night which took quite a while longer than it should have.
    Anyone else experienced this and can suggest something? many thanks Jo

    Run Software Update, wait till all the updates have finished downloading then restart the mac.

  • I just rented a movie on apple tv and there is no sound! Help! I really wanted to see Crazy, Stupid Love tonight!

    I just rented a movie on apple tv and there is no sound! Help! I really wanted to see Crazy, Stupid Love tonight!

    Check your audio out and Dolby digital settings, try restarting the Apple TV by removing all the cables for 30 seconds.

  • My ipad will not sync or back-up and thus cannot install OS5, it starts fine, but then says "cannot verify applications" and stops sync.  Can someone help me?

    my ipad will not sync or back-up and thus cannot install OS5, it starts fine, but then says "cannot verify applications" and stops sync.  Can someone help me?

    going to "transfer purchases' does work - however the thermometer bar at the bottom reflecting apps, music, video, book, etc cpapcity fraks out, sliding left to right maybe 4 or 5 times during the process.  Have you ever seen this?
    After it is finished, the SYNC button is not longer darkened - so I thought it was safe to attampt an upgrade to OS05... which i am doing now... takes maybe 20 mins and then I normally get the error "the applications on this ipad cannot be verified" and the bottom thermometer bar zeros out all by my music.  The content and apps are all fine on teh ipad.  so strange.  I made an appointment with customer service tomrrow AM - but i do not think i should have to pay for this - i have never even used support before!
    I will update if it works - or re[eats the strange pattern again and does not update.
    Thanks for your time and help!

  • When i upgrade my Mac Pro to yosemite safari doesn't good work and doesn't save bookmark plz help me to fix it

    when i upgrade my Mac Pro to yosemite safari doesn't good work and doesn't save bookmark plz help me to fix it

    hi
    when i save a page as boomark shown at the bookmark list when i close safari and restart safari evry bookmark that i saved dosn't show at the bookmark list
    excuse me for whriting i speak a little english
    1 save bookmark and show at the bookmarklist
    2 i close safari
    3 and reopen it
    4any bookmark ,i saved them dosn't show at the bookmark list

  • I bought iphone5 from ol and i didn't know the phone is stolen/lost and i paid 400$.. plz help what should i do?

    i bought iphone5 from ol and i didn't know the phone is stolen/lost and i paid 400$.. plz help what should i do?

    Hand it over to the police if you cannot get a refund.
    You will never be able to use it, it's Activation Lock you're facing and cannot be bypassed without the original Apple ID & password.

  • In Yahoo Mail, when composing an email I get an "Asking to leave this page" panel; it does not matter whether i choose stay or leave, the panel pops up again....and again...the only way out is to Force Quite Firefox and start all over...help please...

    In Yahoo Mail, when composing an email I get an "Asking to leave this page" panel; it does not matter whether i choose stay or leave, the panel pops up again....and again...the only way out is to Force Quite Firefox and start all over...help please...

    Thanks for responding....but isn't your potential solution designed for Windows users? I have a Mac.
    If it does apply to Mac, I am also hoping for something simpler as this could take weeks to isolate the problem and it would be more efficient to use another browser for mail
    Also, I should have added, this problem occurs only occasionally and seemingly only when I am taking some time to compose a message

  • I installed 6.1.3 and lost all important sounds, phone ringer, mail, and text msgs.

    I installed 6.1.3 and lost all important sounds, phone ringer, mail, and text msgs.

    and all sounds , aplication's sounds , music, every thing

  • I just synched for the first time, and lost all my apps. Help?

    I just sync'd my Iphone for the first time, and lost all my apps. Help?

    Ya that sucked, same thing happened to me, however i was looking for an excuse to clean up my phone, so i was not to angry when it happened. As for a remedy to the situation, i have no idea

  • HT201210 error 16, and cannot restore or update, plz help.

    my update was stopped in the middle,
    and next time i tried to restore and update, i cannot do any thing now,
    the error code (16) apprear all the times,
    my network, cable, windows, security, every thing is fine,
    plz help.

    Hello, talatafaq. 
    Thank you for the question.  Here is the article that provides the troubleshooting steps for error 16.
    Check for hardware issues
    Try to restore your iOS device two more times while connected with a cable, computer, and network you know are good. Also, confirm your security software and settings are allowing communication between your device and update servers. If you still see the alert when you update or restore, contact Apple support.
    Common errors: 1, 10-47, 1002, 1011, 1012, 1014, 1000-1020.
    iTunes: Specific update-and-restore error messages and advanced troubleshooting
    http://support.apple.com/kb/TS3694
    Regards,
    Jason H.

  • How to start and stop an embedded sound

    I'm putting a sound of a cat purring in the intro to my animation. I've been asked to make it possible for viewers to turn the sound on and off with buttons. I can do it with an outside sound file by using URLRequest.
    Is there a way to start and stop the sound if it is embedded in my library? If so, can someone give me that script.
    TIA

    Hello mnemo,
    You can use your digital signal to stop your generation with the following property node
    DAQmx-Triggering
    Regards.
    Jean-Baptiste C.
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    >> Téléchargez dès maintenant toutes les présentations techniques !

  • When i download an update for my iphone4 it downloads the full way and then times ou some1 plz help

    when i try to download the update for my iphone 4 its downloads the full wayn on my computer and then just times out some1 plz help its driving me mad

    check out this article and see if there is anything helpful in there: TS3694
    it has all of the meanings of the different error messages and such

  • Stopping all animation upon clickTag

    Pasting the code here...
    I need to make sure that all animations stop upon click-through, but it adding a stop(); into the clickTag does not work.
    Any suggestions would be much appreciated...
    Thanks!
    package
              import com.greensock.*;
              import com.greensock.easing.*;
              import flash.display.MovieClip;
              import flash.events.Event;
              import flash.events.MouseEvent;
              import flash.net.URLRequest;
              import flash.net.navigateToURL;
              public class main300x250 extends MovieClip
              public var paramList:Object;
                        public function main300x250()
                                  addEventListener(Event.ADDED_TO_STAGE, init);
                        private function init(e:Event):void
                                  removeEventListener(Event.ADDED_TO_STAGE, init);
                                  myBTN.addEventListener(MouseEvent.CLICK, clickHandler);
                                  myBTN.addEventListener(MouseEvent.ROLL_OVER, clickOver);
                                  myBTN.addEventListener(MouseEvent.ROLL_OUT, clickOut);
                                  TweenNano.from( t1, .5, {alpha:0, scaleX:0, scaleY:0, ease:Back.easeOut, delay:0});
                                  TweenNano.to( t1, .5, {scaleX:0, scaleY:0, ease:Back.easeIn, delay:1.75});
                                  TweenNano.from( f2.a, .35, {y:"+35", alpha:0, delay:2.25});
                                  TweenNano.from( f2.b, .35, {y:"+35", alpha:0, delay:2.4});
                                  TweenNano.from( f2.nugsL, .5, {x:"-200", ease:Quad.easeIn, delay:2.75});
                                  TweenNano.from( f2.nugsR, .5, {x:"+200", ease:Quad.easeIn, delay:3.15});
                                  TweenNano.to( f2.a, .25, {y:"+15", alpha:0, delay:5.5});
                                  TweenNano.to( f2.b, .25, {y:"+15", alpha:0, delay:5.65});
                                  TweenNano.from( f3.a, .35, {y:"+35", alpha:0, delay:5.75});
                                  TweenNano.to( f2.nugsL, .5, {x:6.5, y:30.5, ease:Quad.easeIn, delay:6.2});
                                  TweenNano.to( f2.nugsR, .5, {x:6.5, y:30.5, ease:Quad.easeIn, delay:6.2});
                                  TweenNano.from( f3.d, .5, {x:"-20", y:"+20", alpha:0, delay:6.6});
                                  TweenNano.to( f3.a, .25, {y:"+15", alpha:0, delay:8.75});
                                  TweenNano.to( f2.nugsL, .25, {x:"+350", delay:8.9});
                                  TweenNano.to( f2.nugsR, .25, {x:"+350", delay:8.9});
                                  TweenNano.to( f3.d, .15, {alpha:0, delay:9});
                                  TweenNano.from(t2, 0.65, {delay:9.15, y:'+='+250, ease:Back.easeOut});
                                  TweenNano.from(t2.a, 0.2, {delay:9.25, y:'+='+75});
                                  TweenNano.from(t2.b, 0.2, {delay:9.45, y:'+='+75});
                                  TweenNano.from(t2.c, 0.2, {delay:9.45, y:'+='+75});
                                  TweenNano.to(t2.b, 0.25, {delay:10.2, x:"-30"});
                                  TweenNano.to(t2.c, 0.25, {delay:10.2, x:"-30"});
                                  TweenNano.to(t2.d, 0.25, {delay:10.2, alpha:1, x:"+31"});
                                  TweenNano.to(endLockUp, 1, {delay:10.2, scaleX:1.15, scaleY:1.15, ease:Quad.easeIn});
                                  TweenNano.from(endLockUp.a, 0.2, {delay:10.2, y:"+200"});
                                  TweenNano.from(endLockUp.b, 0.2, {delay:10.4, x:"-200"});
                                  TweenNano.from(endLockUp.c, 0.2, {delay:10.4, x:"+200"});
                                  TweenNano.from(endLockUp.d, 0.2, {delay:10.6, x:"-200"});
                                  TweenNano.from(endLockUp.e, 0.2, {delay:10.6, x:"+200"});
                                  TweenNano.from(endLockUp.f, 0.2, {delay:10.8, x:"-200"});
                                  TweenNano.from(endLockUp.g, 0.2, {delay:10.8, x:"+200"});
                                  TweenNano.from(endLockUp.h, 0.2, {delay:11, x:"-120"});
                                  TweenNano.from(endLockUp.i, 0.2, {delay:11, x:"+120"});
                                  TweenNano.to(endLockUp, 0.2, {delay:11.2, scaleX:1, scaleY:1});
                                  TweenNano.from( cta, .5, {y:"+200", ease:Back.easeOut, delay:11.4});
                                  TweenNano.from( logo, .15, {y:-62.65 , delay:11.85});
                                  TweenNano.from( legal, .1, {alpha:0, delay:11.9});
                        private function clickOver(e:MouseEvent):void
                                  TweenNano.to( cta, .25, {scaleX:1.15, scaleY:1.15});
                        private function clickOut(e:MouseEvent):void
                                  TweenNano.to( cta, .25, {scaleX:1, scaleY:1});
                        private function clickHandler(e:MouseEvent):void
                                  var clickTag:String = (loaderInfo.parameters.clickTag) ? loaderInfo.parameters.clickTag : '';
                                  if ( (clickTag.substr(0, 5) == "http:") || (clickTag.substr(0, 6) == "https:") ) || MoveClip.stop();
                                            navigateToURL( new URLRequest(clickTag), "_blank");
                                  trace("click");

    you need to loop through all your movieclips and apply a stop().
    that can be automated in a loop with minimal code if it's difficult to list all the movieclips or to know which exist at a particular time.

  • I disconnected my ipod before ejecting, and lost all my music. HELP!

    I disconnected my ipod while it said do not disconnect, and now all my music and movies are gone, but my pictures are still there. I have reset the ipod several times, and tried to connect to itunes. I am getting an error box from itunes saying "ITUNES HAS STOPPED WORKING a problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available" Is there anything I can do? a lot of my music is from other people, and I will not be able to get it back if it's really gone. PLEASE HELP ME!

    Do you sync with iTunes? If you do, all of your purchased content should be in your iTunes library, so sync with iTunes again in order to recover your books and music.
    If you don't sync with iTunes and you only use iCloud, go to the purchased tabs in iTunes and the iBooks app and download all of your music and books again. You will not be charged again as long as you use the same Apple ID that you bought the books and music with originally.

Maybe you are looking for