Stop all nested movieclips

Hello,
I made a series of nested movieclips, and to stop all motion i wrote this code:
on (press) {
MCinMCinMC.stop();
MCinMCinMC.MCinMC.stop();
MCinMCinMC.MCinMC.MC.stop();
MCinMCinMC.MCinMC1.stop();
MCinMCinMC.MCinMC1.MC.stop();
MCinMCinMC.MCinMC2.stop();
MCinMCinMC.MCinMC2.MC.stop();
MCinMCinMC1.stop();
MCinMCinMC1.MCinMC.stop();
MCinMCinMC1.MCinMC.MC.stop();
MCinMCinMC1.MCinMC1.stop();
MCinMCinMC1.MCinMC1.MC.stop();
MCinMCinMC1.MCinMC2.stop();
MCinMCinMC1.MCinMC2.MC.stop();
MCinMCinMC2.stop();
MCinMCinMC2.MCinMC.stop();
MCinMCinMC2.MCinMC.MC.stop();
MCinMCinMC2.MCinMC1.stop();
MCinMCinMC2.MCinMC1.MC.stop();
MCinMCinMC2.MCinMC2.stop();
MCinMCinMC2.MCinMC2.MC.stop();
This code works fine, but can somebody explain how to write this in a more compact way?

Thank you very much!  This will save me an awful lot of typing.
The thing with me and actionscript is, when i read it, i understand what it does, but i have a lot of trouble writing it.

Similar Messages

  • Stop and Play All Child MovieClips in Flash with Actionscript 3.0

    I am stuck with the ActionScript here. I have a very complex animated flash movie for eLearning. These contain around 10 to 15 frames. In each frame I am having multiple movie clip symbols. The animation has been created using a blend of scripting and also normal flash animation.
    Now I want to create pause and play functionality for the entire movie. I was able to create the pause function but when i try to play the movie it behaves very strange.
    I was able to develop the pause functionality by refering to the below mentioned links:
    http://www.unfocus.com/2009/12/07/stop-all-child-movieclips-in-flash-with-actionscript-3-0 /
    http://www.curiousfind.com/blog/174
    Any help in this regard is highly appreciated as i am approaching a deadline.
    I am pasting the code below:
    import flash.display.MovieClip;
    import flash.display.DisplayObjectContainer;
    import flash.utils.Timer;
    import flash.events.TimerEvent;
    import fl.transitions.*;
    import fl.transitions.Tween;
    import fl.transitions.easing.*;
    import fl.transitions.TweenEvent;
    import flash.events.Event;
    import flash.events.MouseEvent;
    stop();
    // function to stop all movieclips
    function stopAll(content:DisplayObjectContainer):void
        if (content is MovieClip)
            (content as MovieClip).stop();
        if (content.numChildren)
            var child:DisplayObjectContainer;
            for (var i:int, n:int = content.numChildren; i < n; ++i)
                if (content.getChildAt(i) is DisplayObjectContainer)
                    child = content.getChildAt(i) as DisplayObjectContainer;
                    if (child.numChildren)
                        stopAll(child);
                    else if (child is MovieClip)
                        (child as MovieClip).stop();
    // function to play all movieclips
    function playAll(content:DisplayObjectContainer):void
        if (content is MovieClip)
            var movieClip:MovieClip = content as MovieClip;
            if (movieClip.currentFrame < movieClip.totalFrames) // if the main timeline has reached the end, don't play it
       movieClip.gotoAndPlay(currentFrame);
        if (content.numChildren)
            var child:DisplayObjectContainer;
            var n:int = content.numChildren;
            for (var i:int = 0; i < n; i++)
                if (content.getChildAt(i) is DisplayObjectContainer)
                    child = content.getChildAt(i) as DisplayObjectContainer;
                    if (child.numChildren)
                        playAll(child);
                    else if (child is MovieClip)
                        var childMovieClip:MovieClip = child as MovieClip;
                        if (childMovieClip.currentFrame < childMovieClip.totalFrames)
          //childMovieClip.play();
          childMovieClip.play();
    function resetMovieClip(movieClip:MovieClip):MovieClip
        var sourceClass:Class = movieClip.constructor;
        var resetMovieClip:MovieClip = new sourceClass();
        return resetMovieClip;
    pauseBtn.addEventListener(MouseEvent.CLICK, onClickStop_1);
    function onClickStop_1(evt:MouseEvent):void
    MovieClip(root).stopAll(this);
    myTimer.stop();
    playBtn.addEventListener(MouseEvent.CLICK, onClickPlay_1);
    function onClickPlay_1(evt:MouseEvent):void
    MovieClip(root).playAll(this);
    myTimer.start();
    Other code which helps in animating the movie and other functionalities are as pasted below:
    stage.addEventListener(Event.RESIZE, mascot);
    function mascot():void {
    // Defining variables
    var mc1:MovieClip = this.mascotAni;
    var sw:Number = stage.stageWidth;
    var sh:Number = stage.stageHeight;
    // resizing movieclip
    mc1.width = sw/3;
    mc1.height = sh/3;
    // positioning mc
    mc1.x = (stage.stageWidth/2)-(mc1.width/2);
    mc1.y = (stage.stageHeight/2)-(mc1.height/2);
    // keeps the mc1 proportional
    mc1.scaleX <= mc1.scaleY ? (mc1.scaleX = mc1.scaleY) : (mc1.scaleY = mc1.scaleX);
    stage.removeEventListener(Event.RESIZE, mascot);
    mascot();
    this.mascotAni.y = 100;
    function mascotReset():void
    // Defining variables
    var mc1:MovieClip = this.mascotAni;
    stage.removeEventListener(Event.RESIZE, mascot);
    mc1.width = 113.45;
    mc1.height = 153.85;
    mc1.x = (stage.stageWidth/2)-(mc1.width/2);
    mc1.y = (stage.stageHeight/2)-(mc1.height/2);
    // keeps the mc1 proportional
    mc1.scaleX <= mc1.scaleY ? (mc1.scaleX = mc1.scaleY) : (mc1.scaleY = mc1.scaleX);
    var interval:int;
    var myTimer:Timer;
    // function to pause timeline
    function pauseClips(secs:int, myClip:MovieClip):void
    interval = secs;
    myTimer = new Timer(interval*1000,0);
    myTimer.addEventListener(TimerEvent.TIMER, goNextFrm);
    myTimer.start();
    function goNextFrm(evt:TimerEvent):void
      myTimer.reset();
      myClip.nextFrame();
      myTimer.removeEventListener(TimerEvent.TIMER, goNextFrm);
    // function to pause timeline on a particular label
    function pauseClipsLabel(secs:int, myClip:MovieClip, myLabel:String):void
    interval = secs;
    myTimer = new Timer(interval*1000,0);
    myTimer.addEventListener(TimerEvent.TIMER, goNextFrm);
    myTimer.start();
    function goNextFrm(evt:TimerEvent):void
      myClip.gotoAndStop(myLabel);
      myTimer.removeEventListener(TimerEvent.TIMER, goNextFrm);
    MovieClip(root).pauseClips(4.5, this);
    // function to fade clips
    function fadeClips(target_mc:MovieClip, next_mc:MovieClip, from:Number, to:Number):void
    var fadeTW:Tween = new Tween(target_mc, "alpha", Strong.easeInOut, from, to, 0.5, true);
    fadeTW.addEventListener(TweenEvent.MOTION_FINISH, fadeFinish);
    function fadeFinish(evt:TweenEvent):void
      next_mc.nextFrame();
      fadeTW.removeEventListener(TweenEvent.MOTION_FINISH, fadeFinish);
    // function to fade clips with speed
    function fadeClipsSpeed(target_mc:MovieClip, next_mc:MovieClip, from:Number, to:Number, speed:int):void
    var fadeTW:Tween = new Tween(target_mc, "alpha", Strong.easeInOut, from, to, speed, true);
    fadeTW.addEventListener(TweenEvent.MOTION_FINISH, fadeFinish);
    function fadeFinish(evt:TweenEvent):void
      next_mc.nextFrame();
      fadeTW.removeEventListener(TweenEvent.MOTION_FINISH, fadeFinish);
    // function to show screen transitions
    function screenFx(target_mc:MovieClip, next_mc:MovieClip):void
    //var tweenTW:Tween = new Tween(target_mc,"alpha",Strong.easeInOut,0,1,1.2,true);
    var tranFx:TransitionManager = new TransitionManager(target_mc);
    tranFx.startTransition({type:Iris, direction:Transition.OUT, duration:1.2, easing:Strong.easeOut, startPoint:5, shape:Iris.CIRCLE});
    tranFx.addEventListener("allTransitionsOutDone",doneTrans);
    function doneTrans(evt:Event):void
      next_mc.nextFrame();
      tranFx.removeEventListener("allTransitionsOutDone",doneTrans);
    // function to show screen transitions inverse
    function screenFxInv(target_mc:MovieClip, next_mc:MovieClip):void
    var tweenTW:Tween = new Tween(target_mc,"alpha",Strong.easeInOut,0,1,1.2,true);
    var tranFx:TransitionManager = new TransitionManager(target_mc);
    tranFx.startTransition({type:Iris, direction:Transition.IN, duration:2, easing:Strong.easeOut, startPoint:5, shape:Iris.SQUARE});
    tranFx.addEventListener("allTransitionsInDone",doneTrans);
    function doneTrans(evt:Event):void
      next_mc.nextFrame();
      tranFx.removeEventListener("allTransitionsInDone",doneTrans);
    // function to zoom in
    function zoomFx(target_mc:MovieClip):void
    //var tweenTW:Tween = new Tween(target_mc,"alpha",Strong.easeInOut,0,1,1.2,true);
    var tranFx:TransitionManager = new TransitionManager(target_mc);
    tranFx.startTransition({type:Zoom, direction:Transition.IN, duration:3, easing:Strong.easeOut});
    //tranFx.addEventListener("allTransitionsInDone",doneTrans);
    /*function doneTrans(evt:Event):void
      next_mc.nextFrame();
    // Blinds Fx
    function wipeFx(target_mc:MovieClip):void
    var tranFx:TransitionManager = new TransitionManager(target_mc);
    tranFx.startTransition({type:Wipe, direction:Transition.IN, duration:3, easing:Strong.easeOut, startPoint:9});
    // Blinds Fx Center
    function fadePixelFx(target_mc:MovieClip):void
    var tranFx:TransitionManager = new TransitionManager(target_mc);
    tranFx.startTransition({type:Fade, direction:Transition.IN, duration:1, easing:Strong.easeOut});
    tranFx.startTransition({type:PixelDissolve, direction:Transition.IN, duration:1, easing:Strong.easeOut, xSections:100, ySections:100});

    This movie is an animated movie from the start to end. I mean to say that though it stops at certain keyframes in the timeline it stops for only a certain time and then moves on to the next animation sequence.
    Its not an application where the user can interact.
    On clicking the play button i want the movie to play normally as it was playing before. If the user has not clicked on the pause button it would anyhow play from start to finish.
    Is there anyway where i could send in the fla file?

  • How to stop , play nested movie clips....

    Hi all,
    I'm calling a swf file in a container_mc, which is in
    another swf file(Interface), by loadMovie() method. The Major
    problem I've stucked with is that in the interface I'm having a
    Play/Pause Button, which is not stopping the nested movieclips of
    the external swf file which is loaded in the container_mc
    movieclip.
    The other major issue is that I'm not able to add a
    progressbar(sliderbar) which runs according to the animation, to
    this interface. Please help ASAP

    I have a similiar situation however the container_mc has me
    puzzled, I'm not sure what that is - perhaps you can answer my
    question:
    I have a master swf called index.swf. The index.swf has a
    main tool bar of buttons which load frames; each frame is named to
    coincide with the main bar button (i.e. genInfo, setup,
    mainentance, etc). This works perfectly. My problem is with Movie
    Clips.
    Each frame has a sidebar which loads external swfs (i.e.
    genInfo.swf) - each external swf is made up of a series of Movie
    Clips which run in succession along the timeline; each Movie Clip
    belongs within its own frame (i.e. MCseg1 is in frame seg1; MCseg2
    is in frame seg2, etc).
    I need to pause and play each individual Movie Clip at will;
    I have built two buttons (pauseBtn and playBtn) into a Movie Clip
    called MCpausePlay. The first frame of MCpausePlay contains the
    pauseBtn; this frame is coded with the global "stop();" In order to
    move to frame(2) which contains the playBtn, the pauseBtn is coded
    with -
    on(release) {
    gotoAndPlay(2);
    The playBtn is coded:
    on(release) {
    gotoAndPlay(1);
    When clicked, the MCpausePlay moves from pause to play.
    That's all I have been able to get this to do.
    How do I code MCpausePlay to pause and then play each
    individual Movie Clip? (How do I get a Movie Clip to control other
    Movie Clips?). Should I code the Movie Clip, the frames within the
    Movie Clip, or each individual button within the Movie Clip? And,
    does this MCpausePlay belong on the Index.swf file, or should it be
    on each external swf? Or perhaps built in to every Movie Clip? I
    have tried all and have not had any success.

  • Stop all movieclips on stage and it's nested movieclips

    Looking for a way to stop all movieclips both are the stage and that are children of the ones on the stage.
    I toyed with looping thru stage's children so I can first target clips on the stage. But I am getting error. Any help?
    for (var i:int = 0; i < this.numChildren; i++)
         if (this.getChildAt(i) is MovieClip)
                        this.getChildAt(i).stop

    You will get a different error if that was just a typo... a 1119 is a property error, a 1061 is a method error, which is what you should have been getting if you just had a typo in your posting and not in your code.    In any case, try casting the object to be a MovieClip and that should solve the probem...
    if (this.getChildAt(i) is MovieClip){
         MovieClip(this.getChildAt(i)).stop();

  • How to stop and resume the animations of nested movieclips

    Hi
    I have many nested movieclips  in different positions of the main timeline.
    I have 2 buttons, play_btn and pause_btn.
    I'd like when the user click pause_btn, the animations on the main timeline and in nested movieclips stop.
    Whe he click play_btn the animations resume in both the main timeline and nested movieclips.
    I have created array of nested movieclips on the main timeline.
    var arr:Array = new Array(mc1, mc2, mc3, mc4, mc5);
    play_btn.addEventListener(MouseEvent.CLICK, on_play_btn);
    pause_btn.addEventListener(MouseEvent.CLICK, on_pause_btn);
    function on_play_btn(e:MouseEvent):void
         gotoAndPlay(currentFrame);
         for(var i:Number = 0; i < arr.length; i++)
             if(arr[i] != null)
                 arr[i].play();
    function on_pause_btn(e:MouseEvent):void
         gotoAndStop(currentFrame);
         for(var k:Number = 0; k < arr.length; k++)
             if(arr[k] != null)
                 arr[k].stop();
    but it only stops the animations on the main timeline and dosen't stop the animations in the nested movieclips.
    Help me Please.

    I'm having the same issue.I have a main timeline, which has nested movieclips with there own timelines and motion tweens. Using the new motion tween, and not the classic tween, which may or may not be the problem.
    Was having a similar issue with stopping the timeline, the main timeline would stop, but the nested movieclips would keep going. Found this blog post that helped.
    http://blog.nobien.net/2009/02/05/as3-stopping-all-timeline-animations/
    Used the code below to stop everything by passing the stage as the displayObject. Worked great, but now i'm having the reverse issue. When I resume play, the nested movieclip timeline stays exactly where I stopped it, and the main timeline resumes play. If there are a 100 frames in the nested movieclip, once it reaches the 101st frame, the main timeline kicks in again.
    function stopAllChildMovieClips(displayObject:DisplayObjectContainer):void{
            var numChildren:int = displayObject.numChildren;
            for (var i:int = 0; i < numChildren; i++) {
                var child:DisplayObject = displayObject.getChildAt(i);
                if (child is DisplayObjectContainer) {
                    if (child is MovieClip) {
                        MovieClip(child).stop();
                        stopAllChildMovieClips(DisplayObjectContainer(child));

  • AS3: Duplicate MovieClips - stop all on start and play only one on MouseEvent

    I have a bunch of copies of the same MovieClip that are dynamically created I want them to be stopped when the swf first starts.  When I click on one of them I want that particular one to play.  I think that I've figured out how to play a single MovieClip with event.currentTarget.play(); but I am stuck on how to stop all the clips from the start.  I thought I could just use a instanceName.stop(); in my for loop, but no go.
    Below is a simplified version of my code:
    //build scroller from xml file
    function buildScroller():void{
         var tl:MovieClip=this;
         for (var i:Number = 0; i < xmlData.sound.loc.length(); i++){
            //create movie clips
            var boxContainer_mc:boxContainer = new boxContainer();
            addChild(boxContainer_mc);
            boxContainer_mc.x = 325 * i;  // set the number here to the width of the movie clip being repeated    
         boxContainer_mc.stop();    
            tl["snd"+i] = new Sound();       
            tl["snd"+i].load(new URLRequest(xmlData.sound.loc[i]));
            boxContainer_mc.snd = tl["snd"+i];
            boxContainer_mc.addEventListener(MouseEvent.CLICK, playSound, false, 0, true);
    function playSound(event:MouseEvent):void {
         event.currentTarget.snd.play();
         event.currentTarget.play();
    I'm an artist working on a piece where I am cataloging sound recordings from people (eventually recorded live from the site... but that's a battle that I'll deal with in phase 2 and after I have a bit more actionScripting under my belt).  I just wanted to explain myself a bit since Kglad, Ned, and dmennenoh have helped me a bunch through the development of the project.  If your interested you can check out some of my works on my website.  I know, I know... I need to update the site, but its more fun to work on new projects.  Oh, and I don't care what you say... I still love animated gifs.

    Ok, I got a most of the issues figured out.  But, I still have one more problem. I have a sound_complete event listener that I want to tell an movieclip to play.  My problem is that I don't know how to reference that movieclip.  Before I was using currentTarget to point directly at the movieclip that was clicked... but this time no movie clip has been clicked.
    Basically all of my questions have been based around the same lack of conceptual understanding.  Could someone explain to me exactly how the different movieclips or instances are referenced once created dynamically?  When they are dynamically created is there an instance name that is created along with it?  The swf file must reference them seperatly in some way... it's just not evident to me.
    Below is the test script that I have that is working.  I want the testing function to play the clip that was originally clicked (right now its just sending out a trace).  In other words: a movieclip is clicked, the movie click plays (until it hits a stop(); in its own action layer), an mp3 file plays, the mp3 finishes, the movieclip continues playing (until it reaches a stop(); at the end of it's own actions script layer).
    for(var i = 0; i < 3; i++){
        var a = new test();
        addChild(a);
        a.x = 20 + (i * 150);
        a.addEventListener(MouseEvent.CLICK, doPlay);
        a.stop();
         a["snd"+i] = new Sound();       
         a["snd"+i].load(new URLRequest("creak128.mp3"));
         a.snd = a["snd"+i];
         a.addEventListener(MouseEvent.CLICK, playSound, false, 0, true);
    function playSound(event:MouseEvent):void {
         var voice = event.currentTarget.snd.play();
         voice.addEventListener(Event.SOUND_COMPLETE, testing);
    var temp:MovieClip;
    function doPlay(e:MouseEvent){
        e.currentTarget.play();
    function testing(e:Event){
        trace("test works");

  • Nested MovieClips

    I have a problem that I think is a simple one but I cannot seem to figure it out, and it has been 2 days of fighting wiht it so I am here to plea for help from the collective experts. Here is the issue.
    I have created a movieClip which is just a rectangle shape that has an interior timeline which object tweens from a 2x200 pixel to a 200x200 pixel shape.
    This movieClip has an instance name of menu_2.
    After the tween happens inside menu_2, on the stop(); frame I have placed another movieClip with an instance name of mi_1. This clip is 100 x 35 pixels and site floating inside the menu_2 MovieClip. Inside this movieClip there is a timeline where there are a "the_start" and a "the_end" label on either end of the timeline each with stop(); comands and some graphics which change opacity.
    What I cannot seem to get to happen is to activate the timeline inside the mi_1 MovieClip. What I would like to happen is that when the user mouses over the mi_1 movieClip, it triggers a number of events, along with triggering playing the timeline inside of mi_2.
    Here is the code I have tried on the main (scene 1) timeline. None of which have worked.
    menu_2.mi_1.onRollOver = function() {
         menu_2.mi_1.gotoAndStop("the_end");
    mi_1.onRollOver = function() {
         mi_1.gotoAndStop("the_end");
    menu_2.onRollOver = function() {
         mi_1.gotoAndStop("the_end");
    menu_2.onRollOver = function() {
    this. mi_1.play();
    Here is the code I have tried inside the menu_2 MovieClip on the same frame as the mi_1 has been placed;
    this.onRollOver = function() {
         mi_1.gotoAndStop("the_end");
    mi_1.onRollOver = function() {
         gotoAndStop("the_end");
    this.onRollOver = function() {
         this.gotoAndStop("the_end");
    Nothing seems to be working.
    I'll send anyone the FLA willing to help...
    Help!
    Forrest

    That's what I thought too Ned. All the reseach I did, tells me that is how you access a nested movieClip in another MovieClip.
    Your visible code works as it should, but I still cannot get the nested MovieClip to be affected by a call to action on the main timeline.
    menu_2.mi_1.onRollOver = function() {
         menu_2.mi_1.gotoAndStop("the_end");
    Did not do anything. I would have just used a button with roll over effects, but a button also seems to be masked inside the menu_2 mc.
    aarrrg.

  • Is there any way to save an image from a nested movieclip as a .png using PNGEncoder

    Hello all,
    I am new to AIR and AS3 and I am developing a small AIR desktop application in Flash CS5 that saves a user generated image locally to their computer. 
    The image is generated from a series of user choices based on .png files that are loaded dynamically into a series of nested movieclips via XML.  The final image is constructed by a series of these "user choices".
    Sourcing alot of code examples from here and there, I have managed to build a "working" example of the application.  I am able to "draw" the parent movieclip to which all the other dynamic movieclips reside and can then encode it using PNGEncoder.  The problem is that the images loaded dynamically into the nested movieclips show as blank in the final .png generated by the user.
    Is there a way to "draw" and encode these nested movieclips or do I need to find another way?  I can provide my clumsy code if required but would like to know if this concept is viable before moving any further.....
    Thanks in advance....

    Thanks for the files.......
    Yeah I'm doing it in Flash but importing the images via an xml document.  The problem isn't in being able to view the eyes (based on the selection of the user) its when I go to save the resulting image as a .png.  When I open up the saved .png the eyes are blank even though they are visible in the swf
    Even when the user clicks on the option to copy the image to the clipboard, it works as intended.
    My only guess is there is an issue with the way my xml is loading (but this appears to work fine) or when the file is converted and saved.....
    As I said I'm still learning but surely there must be a simple answer to this....
    I have included the xml code I am using and also the save code to see if anyone spots an issue..... (I hope I copied it all)
    // XML
    import flash.net.URLRequest;
    import flash.net.URLLoader;
    var xmlRequest:URLRequest = new URLRequest("imageData.xml");
    var xmlLoader:URLLoader = new URLLoader(xmlRequest);
    var imgData:XML;
    var imageLoader:Loader;
    var imgNum:Number = 0;
    var numberOfChildren:Number;
    function packaged():void
    rawImage = imgData.image[imgNum].imgURL;
    numberOfChildren = imgData.*.length();
    imageLoader = new Loader  ;
    imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadedImage);
    imageLoader.load(new URLRequest(rawImage));
    faceBG_mc.Eyes.addChild(imageLoader);
    function loadedImage(event:Event):void
    imageLoader.x = -186;
    imageLoader.y = -94;
    imageLoader.width = 373;
    imageLoader.height = 186;
    //  Clipboard
    btn_Copy.addEventListener(MouseEvent.CLICK, onCopyClick);
    function onCopyClick(event:MouseEvent):void
    var bd:BitmapData = renderBitmapData();
    Clipboard.generalClipboard.setData(ClipboardFormats.BITMAP_FORMAT, bd);
    function renderBitmapData():BitmapData
    var bd:BitmapData = new BitmapData(faceBG_mc.width,faceBG_mc.height);
    bd.draw(faceBG_mc);
    return bd;
    // Save faceBG_mc as .png 
    var fileRef:FileReference = new FileReference();
    var myBitmapData:BitmapData = new BitmapData (faceBG_mc.width,faceBG_mc.height, true, 0);
    myBitmapData.draw(faceBG_mc);
    var myPNG:ByteArray = PNGEncoder.encode(myBitmapData);
    function onSaveClickPNG(e:Event)
    fileRef.save(myPNG, "myPNG.png");
    So my problem is....
    The final image is copied to the clipboard with the eyes visible - yes
    The eyes appear in the image in the swf as intended - yes
    When the image is saved as a .png and is meant to include the eyes, they are blank (see picture above)
    I hope this helps.....
    Thanks in advance

  • 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.

  • How to stop all sounds in root

    Sorry I am a newvby to Actionscript.  I found the following script for a button which let me  stop all mc inside the root but I need to stop all sounds in the root as well.
    Any help is appreciated.
    Thanks
    on (press) {
    getAllMc(_level0);
    function getAllMc(mc) {
        for (var i in mc) {
            if (typeof mc[i] == "movieclip") {
    mc[i].stop();
                    getAllMc(mc[i]);

    You can use the stopAllSounds() function

  • 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.

  • How do I stop all of my music in my itunes library syncing to my iphone 5 even when the songs aren't ticked?

    How do I stop all of my music in my itunes library syncing to my iphone 5 even when the songs aren't ticked?

    The frustrating part about the restore is that is seems to be finished when it in fact is not.  The restore will look "finish" and your phone will be at the Swipe to Unlock screen. If you swipe and look at your home screen at this point of the restore, you'll see everything is not quite right.  While the process seems to be not doing anything just leave the phone attached and do something else for about an hour.  This part of the process is not mentioned during the restore operation.  I believe there are about two steps to the restore process: 1) restore the phone settings (ringtones, background, notification settings, etc.) and give the user the unlock screen; 2) without letting the user know there is still more to do, begin the slow process of restoring all the music, movies, apps and what not.  It's this second step that causes the confusion.  Nothing lets you know to wait that process out.  I've restored a couple devices from a computer backup and the 2-step process looks the same.

  • A lot of tabs loads and tells me there was a problem loading the page. How can I stop all the tabs loading because ist slows down Firefox.

    When I open Firefox, a lot of tabs try to open at the same time. They all say Problem loading the page. It happened after I tried to download a owners manual for Harley Davidson motor cycles. How can I stop all but one tab from opening.

    This can be a problem with the file [http://kb.mozillazine.org/sessionstore.js sessionstore.js] and sessionstore.bak in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Profile Folder]
    Delete [http://kb.mozillazine.org/sessionstore.js sessionstore.js] and sessionstore.bak in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Profile Folder]
    If you see files sessionstore-##.js with a number in the left part of the name like sessionstore-1.js then delete those as well.
    See:
    * http://kb.mozillazine.org/Session_Restore

  • How do I stop all the tab and pop-up adds?

    Every time I click on something on the main tab, another one open with some type of add. Also, I want to stop all the pop-up adds. If this can't be done I will be uninstalling Firefox.

    You also can check for an add-on causing this problem.
    Disable ALL nonessential or unrecognized add-ons on these two tabs. Unless you know you can't live without it for 24 hours, disable it.
    orange Firefox button (or Tools menu) > Add-ons > Plugins category<br>
    orange Firefox button (or Tools menu) > Add-ons > Extensions category
    If you see a link above an extension to restart Firefox, you can wait until you are done with your changes and then click that as the last step.

  • How do i stop all my devices ringing when we share itunes

    how do i stop all my devices ringing when we share itunes

    On all devices go to settings - facetime - iphone cellular calls - off

Maybe you are looking for

  • Lync 2013 Server / Roles & Components

    Lync 2013 Server / Roles & Components  Front End User authentication and registration Presence information and contact card exchange Address book services and distribution list expansion IM functionality, including multiparty IM conferences Web confe

  • Already have LR5 & CS6 - Signed up for photo CC do I need to re-download?

    I have paid licenses for LR5 and CS6 with Photoshop and other applications.  I sigend up for the Photo CC and wonder if I need to downloand the LR & PS to activate CC?  Also will I be able to retain my full license of PS and LR?

  • Incorrect query result with Top N condition and two structures

    Hi, I have created a query on a FI-GL infocube with the characteristic 0BUS_AREA in rows and two structures in columns. The first structure has two items / selections (each item is a selection of several GL accounts). The second structure has two ite

  • Getting carryforward bal in F.08

    Dear Members : Running GL Acc Balances (F.08) is not showing carry-forward balance for P&L stmt type accounts - this inspite after running balance carry forward (F.16). But F.08 does show carry-forward balances for balance sheet type accnts. Could yo

  • Creating playlist with Windows Media Player 11

    I created a playlist in WMP 11 and sync'd it with my Pixi Plus.  I also saved the playlist as a M3U file in the Music folder of my Pixi Plus, but when I try to open the playlist in the music section of the phone,  it say's 'no items available'.   How