Only one layer stops

I have successfully managed to make play and pause controls which plays and pauses all movieclips and assigned soundchannels. The problem I have is that only the child movieclip which is placed on the top layer stops and plays and the other child movieclips are ignored.
Here is the code:
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.events.MouseEvent;
import flash.display.MovieClip;
pause_btn.visible = true;
play_btn.visible = false;
var mySound:Sound = new MyFavSong();
var myChannel:SoundChannel = new SoundChannel();
var lastPosition:Number = 0;
myChannel = mySound.play();
pause_btn.addEventListener(MouseEvent.CLICK, onClickPause);
function onClickPause(e:MouseEvent):void{
    lastPosition = myChannel.position;
    myChannel.stop();
    stopMovieClip(container);
    pause_btn.visible = false;
    play_btn.visible = true;
function stopMovieClip(mc:MovieClip):void{
  mc.stop();
  for (var i:int = 0; i < mc.numChildren; i++)
  var mcChild = mc.getChildAt(i);
     if (mcChild is MovieClip) stopMovieClip(mcChild);
play_btn.addEventListener(MouseEvent.CLICK, onClickPlay);
function onClickPlay(e:MouseEvent):void{
    myChannel = mySound.play(lastPosition);
    playMovieClip(container);
    pause_btn.visible = true;
    play_btn.visible = false;
function playMovieClip(mcPlaying:MovieClip):void{
  mcPlaying.play();
  for (var j:int = 0; j < mcPlaying.numChildren; j++)
  var mcPlay = mcPlaying.getChildAt(j);
     if (mcPlay is MovieClip) playMovieClip(mcPlay);   
And the .fla: http://www30.zippyshare.com/v/71537447/file.html
The movieclip named "container" is the parent which contains three different child movieclips (1-10, 10-1, colours) 1-10 is on the top layer and is the only movieclip which plays and pauses the others get ignored but if I swap the order round the others work only if they are on the top layer.
It's probably easier to check out the .fla than to try to explain it!
Any help would be appreciated.
Thanks
Phil

First off, your stopMovieClip function is not closed - you're missing the } after the one that closes the for loop.
Then within that function you are calling stopMovieClip - instead of just calling stop on the clip. It's not a recursive function so that's not going to work.
I think you want something like this:
function stopMovieClip(mc:MovieClip):void{
  mc.stop();
  for (var i:int = 0; i < mc.numChildren; i++)
  var mcChild = mc.getChildAt(i);
     if (mcChild is MovieClip){
          mcChild.stop();

Similar Messages

  • Replace one channel by another on only one layer, leaving the others intact?

    Hello. In a CMYK image, I need to turn on only one layer one channel completely into another, while the others remain intact. The M channel (the M on that layer) contains information, but I can't print M in this place. I want to change it into an equal amount of K (or into C, in the present case, or even into a mixture of the two). I know how to do this to an entire image (change into greyscale, duotone or whatever may apply). But since I need this to apply to only one (or a selection of) layer(s), leaving all others intact, this is not an option here. I'm sure there's a way to achive this, but I can't find it. Any advice would be much appreciated.

    bustamant wrote:
    hello, thanks for your replies. As far as I understand, Channel Mixer (i.e., an Adjustment Layer containing a Channel Mixer applied to the layer in question) allows me to reduce one channel to zero,
    You are completely correct up to here...
    Then choose K as the desired output channel at the top of the palette and slide the M (source) slider to the desired value.  You can choose more output channels by going to each output channel in turn.
    The way it works is slightly confusing at first, but in a nutshell, you choose your output channel first, then mixture of sources.  Then move to another output channel and the sources will be at the default position for THAT output channel only.  Each channel has a set of source channels assigned to it.
    Default;  black output channel = 100% black source, 0% CMY
    So your example is black output = 100% black source plus 100% mag source (although I expect you are going to change black source to 0)
    AND magenta output = 0% Magenta 0% CYK source  (no mag output at all)

  • Applying feathering to only one layer

    Hi,
    I'm created a two-part ad.  One of the two parts (on two different layers) has a background image that I would like only the center to show up and the rest I'd like to whiten (about 90% opacity, leaving 10% of the background image visible) using feathering, as described in Feather Selections In Photoshop With Quick Mask
    So, does anyone know how to apply such feathering on only one layer?
    Thanks!
    -Ron

    Create a Layer Mask and apply Feather in the Properties Panel.
    Could you please post a screenshot with the Layers Panel visible?

  • Make only one layer of a video brighter

    Hi,
    I have few layers of videos, I am trying to make only one layer brighter.
    How can I do that?
    Thanks,

    Hmm, select the layer in the timeline, go to the effects menu, scroll down to color correction, in that menu choose brightness and contrast and adjust the brightness to your liking. It will only be applied to that layer.

  • Why does a my layered Illustrator file open with only one layer, when opened by someone else?

    I am using CS6, as is the other user.  When they open the file in Illustrator all the artwork is on one layer, even though the original file has numerous layers, and opens with these layers when I open it even now.
    I have never come across this problem before in all the years I have used Illustrator and have had no joy when trying to search for this problem.
    Any ideas or help would be greatly appreciated as it is confusing us!
    Thank you.

    Hi Mike, Wade & Larry,
    Thank you so much for your replies.
    Since I posted this issue, I was later informed that the other user is infact opening my files with CS5 and so a quick solution to this was saving it down to a previous version! Sorry for the confusion!
    This problem then becomes clear that it was a version error, but I have always had an error message come up if I try to open something that was created in a newer verion - is this no longer the case?
    I have been assured no pop up messages appear when opening the file which I find odd, and also that this layer compression has only just started happening even though many files have been back and forth previously.
    A little mystery! At least for now it is all working ok again
    Thank you all very much, greatly appreciated.

  • How can I edit separate layers in a psd file that was saved as only one layer?

    A designer provided me with a finished design and provided the psd, eps and ai files.  I'd like to make some minor changes in PS and would like to access individual layers - e.g. the text, background, etc.  When I open the psd file, however, it only has one layer.  how do I break out the original layers so that I can edit them?

    You can't. Once it's been flattened, you can't unflatten it. Talk to your designer: he/she will most likely have the unflattened version available.

  • Only one layer slow

    in cs6, working in black and white, 800mb file when flat, 3gb with layers.  One layer only is super slow.   it's not the largest layer. it's just a small image fragment.  but when I try smudging in that layer, computer freezes up and start to move super slow.   I tried copy and paste image content into new layer without improvement.   Slowness started happening after I stretched the layer.   I have since opened and closed this document many times. restarted computer.  duplicated layer into new file doesn't improve the matter either. 

    samlarson wrote:
    UPDATE:   when I move this layer outside of the group it's in it moves at normal speed....
    We cross posted there.  I am not sure why being grouped would slow down a layer

  • Colorize only one layer

    I'm using Trapcode Particular to generate an effect on to[ of a video and use a colorize adjustment layer to colorize the effect. Problem is that this also colorizes the video which is below the effect so how can I apply it only to the effect and leave the colors of the video unchanged?
    thanks!

    I can't do that because it won't change the color. Only works with an adjustment layer. Pre-Compose is useless since that removes the whole effect all together. So what now??
    I really don't know what you are talking about. Applying an adjustment layer effectively treats the output from Particular as a 2D layer, which is no different what happens under normal circumstances if you apply the effect directly - to the result buffer of the previous effect/ operation. You are trying to see distinction where there is none. Some effects ignore Alpha and such, but that's a whole different matter. If 3D interaction is a concern, you wouldn't use adjustment layers at all as it breaks 3D rendering order, resulting in incorrect overlaps. So by all means, either you are doing something fundamentally wrong or just fail to give us a clear impression of what it actualyl is you are trying to do, so please elaborate, provide a screenshot, link to a reference clip or something like that.
    Mylenium

  • Using adjustment layers to only one layer

    I know how to use an adjustment layer - it goes directly over the layer I'm editing and I'm able to edit the colour (such as hue etc). The trouble is, anything below that adjustment layer then gets affected. Is there any way I am able to make this adjustment layer exclusive to a partuclar layer?
    Ideally then in that sitation I'd be able to have a bitmap layer using a vector mask (for example, a cut out tree) and then using an adjustment layer to change the colour of the tree.
    Hope I've explained it well enough, it's a bit confusing.
    Thanks.

    I'm new to CS5, but find that if I create an adjustment layer from the "Adjustments" window I automatically get the chain link icon in the layers window showing the two layers linked, then the adjustment only affects the layer below.   However, if you use Layer|New Adjustment Layer|Levels (for example) then you have the option to use previous layer as a clipping mask if you tick that box it is linked just to the previous layer, left unchecked it affects all layers below.

  • Power Plane Problem: Only one layer as an option.

    Dear all,
    I try to use Create Power Plane tool as usually, but for some reason bottom layer is already selected and it can not be changed. I am using dual layer board, so there should be also top layer. I can draw traces and everything except the power plane on the top layer.
    I have made many dual layer boards without any problems with Power Planes. I can't figure out what I am doing differently from the previous boards.
    Any ideas?

    Hi,
    Try this:
    1.  Select Edit>>Selection Filter, disable all filters except for "Enable polygon", the default toolbars should have the filters option so you don't have to go back to the menu.
    2.  Select Edit>>Select All to select all copper area and power plane on the work area,
    3.  Press Delete,
    Now try placing the power plane again.  If this doesn't work, please send me the file, I will see if I can fix it for you.  Create a service request at:
    http://sine.ni.com/apps/utf8/niae_asc.main?lang=US
    Tien P.
    National Instruments

  • How to remove text from photo only one layer?

    How do I remove text from this photo? plz & ty
    o I remove text from a photo?

    Contact the person who took the photo and ask for a clean copy.
    If you don't know the photographer, chances are good that your use of the photo would be a violation of copyright.

  • My photos are not showing up as layers in the layers panel, only as one layer, so I can't make any changes to the layers.  Does anyone know why this is happening?  Am I downloading them from my camera wrong?

    My photos are not showing up as layers in the layers panel, only as one layer, so I am not able to make changes to the layers.  Does anyone know why this is happening?   Am I downloading them from my camera wrong?  I have watched the video and the photos don't open that way on my layers panel. Any help would be appreciated, I would like to edit out the background and turn it a different color.

    barba87623950 a écrit:
    My photos are not showing up as layers in the layers panel, only as one layer, so I am not able to make changes to the layers.  Does anyone know why this is happening?   Am I downloading them from my camera wrong?  I have watched the video and the photos don't open that way on my layers panel. Any help would be appreciated, I would like to edit out the background and turn it a different color.
    Photos from cameras or scans have only one layer (the 'background' layer).
    You can start with that 'background' layer and duplicate it or add other layers in the editing process. For instance you can make a selection of a subject and put it on another layer; a common use is to desaturate the 'background' and to keep the color in the selected subject in your newly created layer.

  • Saved PSD file shows only as one layer

    I used to use Photohop CS2. I have plenty of files all with layers. I am no longer able to access those files because I don't have Photoshop any longer. I am also not able to purchase the latest Photoshop. I have tried loading the files in Gimp as well as using Xnview to try to convert the file into anything usable, but both programs show the files as possessing only one layer even though I am opening the PSD full file which actually does have all the layers.
    Is there any way for me to retrieve or ever use these files again, or will the only way I have to access them be to purchase the latest version of Photoshop?
    Thanks.

    Did you ever read my reply in post #5?  
    My suggestion would be to download a trial version of Photoshop, whatever runs on your machine, and use the Image Processor in Photoshop to batch convert all your files as TIFFs before the 30-day trial period is over.

  • Hand tool for one layer

    Using CS5 on Windows 7.  I'm trying to use the hand tool to move one layer, but it will only scroll all layers together:
    Scroll All Windows is unchecked (and unchanged while selected)
    Layers are not grouped
    Layers are not linked
    Only one layer is selected at the time.
    I tried all of the above both with hand tool selected, and using scroll bar with brushes selected.
    Any ideas how I can use the hand tool on only one layer?  I;ve never had this problem before, on this computer (with earlier versions) or any other.

    I assume that you found the Move Tool, and that all is working, as you wish now.
    Happy editing,
    Hunt

  • How can I stop using my primary Apple ID (Gmail) but leave my secondary Apple ID (icloud) as primary ond only ONE?

    Good afternoon friends.
    Please help me and tell how can I stop using my primary Apple ID (Gmail) but leave my secondary Apple ID (icloud) as primary ond only ONE?
    I started using Apple ID in 2011 when iCloud was not exist and was forced to use non-apple e-mail adress as primary ID.
    So I used GMail mailbox.
    When iCloud was started I created my account but unfortunatelly can't remove this Gmail address from my Apple ID and replace it with icloud mail address.
    I was VERY dissapointed because I don't want to use "outside" mailbox to get letters from Apple and ny ID.
    In fact I see the Apple old users and fans discrimination.
    When creating new user accounts are free to create a box on the iCloud mail and use it as a primary ID, and the only ONE.
    At the same time the old user is obliged to keep third-party mail box like Gmail etc. as the primary and can not get such an opportunity, as a new user
    This is extremely inconvenient and a VERY strange logical.
    For example, now I want to stop using this mailbox on Gmail but I can not do that because in this case I lose access to my ID, or run the risk that someone in the future will create a box with the same name on Gmail (when name will be free and available) and will automatically get access to my accounts on Apple and to my Apple ID.
    Now, to avoid this, your team, I offer the only way out: ID, create anew.
    Of course it's possible, but then:
    - I lose all my purchases for 3 years and will be forced to make them again and pay money for the second time for my purchases
    - Lose access to the familiar iCloud e-mail address who now serves as secondary ID because this e-mail address is almost no longer available and will never be released in future.
    And now answer me for ONLY TWO questions:
    - WHERE IS LOGIC?
    - WHAT ABOUT TO BE FRIENDLY FOR YOUR USERS AND FANS?
    Thank you!
    Hopefully for your GOOD answers.

    You cannot make your @icloud.com address the login address for the ID. However you can change your ID, currently a Gmail one, to any other functioning non-Apple email address. The Gmail address would then no longer access your account, and so even if someone were to obtain posession of it (is that even possible) it wouldn't allow them to get into your account.
    If you want to change your ID to another email address please follow the procedure outlined below, particularly noting the first step.
    Firstly, if you have 'Find My iPhone/iPad/iMac' enabled on any of your devices, turn it off.
    Create a new email address, for example  at Yahoo or Gmail, or anywhere convenient (or you can use an existing address as long as it has never been associated with an Apple ID).
    Go to http://appleid.apple.com and click 'Manage your Apple ID'. Sign in with the current ID.
    Where it says 'Apple ID and primary email address' and gives your current ID email address, click 'edit'.
    Enter your new address and click 'Save changes'.
    Now you will need to go to each of your devices and sign out in System Preferences (or Settings)>iCloud - 'Sign out' on a Mac, 'Delete this account' on an iOS device (this will not delete the account from the server).
    Then sign back in with your new ID. Your iCloud data will disappear from your devices when you sign out, but reappear when you sign back in.
    I re-iterate: before you start, turn off 'Find My Mac' (or whatever) or you will need the services of Support.

Maybe you are looking for

  • Read Table : Error Stating mandt field is not filled.

    Dear members, I am get syntax error when using Read table statement saying mandt field is not filled, however if I remove the KEY field. it is working fine. please let me know, where I am doing mistake. thank you. Data : spfli_tab like STANDARD TABLE

  • Error in uwl message text

    hi all,    I have a problem with a message in Italian which appears when the task list is empty, the message translated into English would be "no items found" but in Italian  the message is incorrect, how can I fix it? Thanks Rocco

  • XL Reporter Error: Permission denied

    Dear all expert, I'm having problem when running xl reporter. The error is "could not start Microsoft Excel. Micosoft Excel is required to start XL Reporter, Error, Permission Denied..There is already installed microsoft excel version 2007 and I alre

  • Slide presentation loading bar

    Hello, Is there a way I can add a loading bar to each slide in a presentation? I want to create a frontpage component for a web site using Flash CS3 Slide Presentations. I have several flash movies that I want loaded into the presentation and then us

  • Creating worker threads in J2EE application deployed in OAS...

    Will OAS allow for the creation of worker threads in a J2EE application? I can create a worker thread in my J2EE application that is deployed in OC4J Standalone, I need to verify if the same capabilities exist in OAS. Thank you, Jason