Remove Child and Event.SOUND_COMPLETE not working inside movie clip. What's the problem?

I have a movie clip that is called to the stage. The user then clicks a button and music plays. As the music starts, another movie clip is called, a simulation of  an equilizer. There are several things that should happen:
1) When the user closes the movie clip the music is supposed to stop playing and the equilizer movie clip is removed. What actually happens is the music stops playing but  the equilzer movie clip is not removed.
2) When the music is finished playing the equilzer is supposed to be removed from the stage and the play button is reactivated. But none of that happens. When I click on the movie clip a second time equilizer is still there and the play button is not reactivated.
Here's the code that calls the movie clip to the stage.
stage.addEventListener(MouseEvent.MOUSE_DOWN, goButtons);
function goButtons(event:MouseEvent):void
    if (event.target == Song_bnt)
        SoundMixer.stopAll();
        addChild(myPlaySong);
        myPlaySong.x = 304;
        myPlaySong.y = 105;
        //event.stopImmediatePropagation();
Here's the code in the movie clip:
import flash.media.Sound;
import flash.events.Event;
stop();
var playRayJaySong:RJSong;
var playRayJaySongChannel:SoundChannel;
var equilizer:Equilizer;
equilizer = new Equilizer();
playRayJaySong = new RJSong();
//Plays music, inactivates buttons, and adds the equilizer to the stage.
PlaySongRJClip.addEventListener(MouseEvent.MOUSE_DOWN, songPageButton);
function songPageButton(event:Event):void
    playRayJaySongChannel = playRayJaySong.play();
    PlaySongRJClip.visible = false;
    ClicktoPlaySong.visible = false;
    addChild(equilizer);
    equilizer.x = 269;
    equilizer.y = 246;
//Removes the equilizer from the stage when the music is complete.
PlaySongRJClip.addEventListener(Event.SOUND_COMPLETE, rjSoundComplete);
    function rjSoundComplete(e:Event):void
    PlaySongRJClip.visible = true;
    ClicktoPlaySong.visible = true;
    removeChild(equilizer);
//Removes the equilizer and event listeners from stage and calls dispatch event to close the movie clip.
closeSong_bnt.addEventListener(MouseEvent.MOUSE_DOWN, CloseSong);
function CloseSong(event:MouseEvent):void
    removeChild(equilizer);
    dispatchEvent(new Event("RemoveMSong"));
    PlaySongRJClip.removeEventListener(MouseEvent.MOUSE_DOWN, songPageButton);
    PlaySongRJClip.removeEventListener(Event.SOUND_COMPLETE, rjSoundComplete);
//Removes the MovieClip from the stage when the user clicks on the close button inside the MovieClip.
myPlaySong.addEventListener("RemoveMSong", RemoveSongClip);
function RemoveSongClip(e:Event):void
    SoundMixer.stopAll();
    removeChild(myPlaySong);
Any thoughts?

I figured out the problem. Here's how I reorganized the code (all in one frame).
//Code for Ray Jay song.
var playRayJaySong:RJSong;
var playRayJaySongChannel:SoundChannel;
playRayJaySong = new RJSong();
myPlaySong.equilizer_inst.visible = false;
//Plays the song.
myPlaySong.PlaySongRJClip.addEventListener(MouseEvent.MOUSE_DOWN, songPageButton);
function songPageButton(event:Event):void
    playRayJaySongChannel = playRayJaySong.play();
    playRayJaySongChannel.addEventListener(Event.SOUND_COMPLETE, rjSoundComplete);
    myPlaySong.equilizer_inst.visible = true;
    myPlaySong.PlaySongRJClip.visible = false;
    myPlaySong.ClicktoPlaySong.visible = false;
//Removes the MovieClip from the stage when the user clicks on the close button inside the MovieClip.
myPlaySong.closeSong_bnt.addEventListener(MouseEvent.CLICK,RemoveSongClip);
function RemoveSongClip(e:Event):void
    SoundMixer.stopAll();
    removeChild(myPlaySong);
    myPlaySong.equilizer_inst.visible = false;
    myPlaySong.PlaySongRJClip.visible = true;
    myPlaySong.ClicktoPlaySong.visible = true;
    playRayJaySongChannel.removeEventListener(Event.SOUND_COMPLETE, rjSoundComplete);
//Resets all of the movieclips to their orginal state.
function rjSoundComplete(e:Event):void
    myPlaySong.equilizer_inst.visible = false;
    myPlaySong.PlaySongRJClip.visible = true;
    myPlaySong.ClicktoPlaySong.visible = true;
Thanks all for your suggests and input.

Similar Messages

  • Histograph is not working in my executable, what is the problem?

    I created an executable using labview's application builder.  I have installed the correct labview run time engine, and the executable works, except everything that is corrlated with the IMAQ histograph.  Is there something that I haven't installed correctly? Or possibly, something that is not complied correctly?  Any help would be appreciated.

    A couple of comments:
    First, start a new thread with your new question. You tagged a message onto the end of a thread from 2008 - you're lucky anybody saw it.
    Second, when you start that new thread, provide some details as to what is or is not happening.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • I recently purchased Macbook air mid 2013. Leftside usb port is not working. I think the USB is not going inside completely. What is the solution?

    I recently purchased Macbook air mid 2013. Leftside usb port is not working. I think the USB is not going inside completely. What is the solution? someone can help?

    Invoke your warranty and take it back.

  • In my numeric key pad I can not use the (.) dot because it has a (,) and it is not working in calculations.  What I can do?

    In my numeric key pad I can not use the decimal dot (.) because it has a (,) and this not work with decimal calculations.  What I can do?  Help ………

    IT NOT WORK IN MEXICO.  THANKS A LOT.  BEST REGARDS.  MANUEL LOPEZ
    El 6/2/2015, a las 16:50, Apple Support Communities Updates <[email protected]> escribió:
    You received a reply
    SGIII has replied to your question. You can view the full discussion in Apple Support Communities.
    In my numeric key pad I can not use the (.) dot because it has a (,) and it is not working in calculations.  What I can do?
    Correct Answer Helpful Answer
    Use the buttons above to tell SGIII and the rest of the community if this reply solved your question or helped you get closer to finding a solution.
    To reply to SGIII, go to the discussion in Apple Support Communities.
    You are receiving this email from Apple Support Communities. You can change your email preferences in your Apple Support Communities Profile.
    TM and copyright © 2014 Apple Inc. 1 Infinite Loop, MS 96-DM. Cupertino, CA 95014.
    All Rights Reserved | Privacy Policy | Terms of Use | Apple Support

  • When importing clips to iMovie11 the audio is missing. I have been able to successfully to this in the past and all of the sudden it is not working. Any help to solve the problem would be appreciated.

    When importing clips to iMovie11 the audio is missing. I have been able to successfully to this in the past and all of the sudden it is not working. Any help to solve the problem would be appreciated.
    Thank you for your help!

    Download/install an app is a know possible solution.
    3. Install another app from the App Store
    If all user-installed apps are not launching, it could be an Apple ID authorization issue. Download and install an app that isn't already installed on your device to reset this information.
    Note: If you have installed apps using multiple Apple ID accounts, you may need to perform this step for each account.
    Above from Apple's :
    iOS: Troubleshooting applications purchased from the App Store

  • HT201335 when using apple tv with my ipad, the mirroring function does not work, screen goes black, what is the issue?

    when using apple tv with my ipad, the mirroring function does not work, screen goes black, what is the issue?  My son's Ipad(same as kind as mine) works ok with the apple tv but mine does not.  Any suggestions?

    Hello Nina Izurin,
    While written for the iPhone, the troubleshooting below can help resolve issues with your iPad's camera, as well.
    Camera isn't functioning or has undesired image quality
    If the screen shows a closed lens or black image, force quit the Camera app.
    If you do not see the Camera app on the Home screen, try searching for it in Spotlight. If the camera does not show up in the search, check to make sure that Restrictions are not turned on by tappingSettings > General > Restrictions.
    Ensure the camera lens is clean and free from any obstructions. Use a microfiber polishing cloth to clean the lens.
    Cases can interfere with the camera and the flash. Try gently cleaning the lens with a clean dry cloth or removing the case if you see image or color-quality issues with photos.
    Try turning iPhone off and then back on.
    Tap to focus the camera on the subject. The image may pulse or briefly go in and out of focus as it adjusts.
    Try to remain steady while focusing:
    Still images: Remain steady while taking the picture. If you move too far in any direction, the camera automatically refocuses to the center.
    Note: If you take a picture with iPhone turned sideways, it is automatically saved in landscape orientation.
    Video: Adjust focus before you begin recording. You can also tap to readjust focus while recording. Exiting the Camera application while recording will stop recording and will save the video to the Camera Roll.
    Note: Video-recording features are not available on original iPhone or iPhone 3G.
    If your iPhone has a front and rear camera, try switching between them to verify if the issue persists on both.
    My issue is still not resolved. What do I do next?
    Contact Apple Support.
    iPhone: Hardware troubleshooting
    http://support.apple.com/kb/TS2802
    Cheers,
    Allen

  • Adobe creative cloud product online help not working. Any idea what is the reason ??

    Adobe creative cloud product online help not working. Any idea what is the reason ??
    I have to manually copy pdf file to open help for all suite....

    Please try another browser, if still it is not working, check the internet connectivity http://helpx.adobe.com/x-productkb/policy-pricing/activation-network-issues.html
    In case the issue is still not resolved, do contact Adobe Support.
    Regards
    Rajshree

  • I want to change my account in the AppStore from USA to Saudi , but there are some cents 0.04 $ prevent change to Saudi and I do not need these cents So what is the solution ?

    I want to change my account in the AppStore from USA to Saudi , but there are some cents 0.04 $ prevent change to Saudi and I do not need these cents So what is the solution ?

    Click here and request assistance.
    (88185)

  • My sound mixer and youtube is not responding..please can u fixed the problem w/ any kind of solution

    my sound mixer and youtube is not responding..please can u fixed the problems w/ any kind solutions???.. thanx much...appreciate it.......ALVIN....

    Alvin,
    See this Link:
    Solution to Fix Youtube or Other Embedded Flash Video No Sound in External Websites
    Source Thread / Credits to Daniel Potyrala
    NO SOUND FROM YOUTUBE VIDEOS
    I hope this helps!
    Good Luck!
                              When you appreciate the help…
           Please Click the Kudos Star on the Left to say "Thank You"!
     Is it Solved? Please Click this Post “Accept as Solution” to say "Yes!"
     Remember:  The more information you provide, the better help you can receive.
    Always Include:  (Notebook) Product Number  ,  Printer – Model Number ,
                            Operating System and an Error Description
                                 Never give out your Serial Number
                                     2012 Year of the Dragon!
    Kind Regards,
    Dragon-Fur

  • I need to go very very near to my wireless modem to find my network and if i go a little far i can not connect but before it was not like that?!what is the problem?!

    I need to go very very near to my wireless modem to find my network and if i go a little far i can not connect but before it was not like that?!what is the problem?!

    Hey Babakgh,
    I understand that you've experienced recent issues with your Wi-Fi network where you can only connect to it if you're close to the router. I would start off troubleshooting your Wi-Fi network by following the steps in here:
    iOS: Troubleshooting Wi-Fi networks and connections
    http://support.apple.com/kb/TS1398
    Take care,
    Delgadoh

  • I have had Itunes installed on my laptop for many years. I t started malfunctioning so I uninstalled it. I tried to reinstall and there is persistent error in installing . What is the problem ? How can I solve this?

     

    "It started malfunctioning so I uninstalled it".
    That may have been necessary, may not have.
    "I tried to reinstall and there is persistent error in installing.  What is the problem?"
    No clue.. you've not provided us any details. 
    "How can I solve this?"
    Search these forums or google for the error occurring or post the error so that others can help you.

  • Effects and key-frames not working on some clips Premiere CC 2014

    Hi. I am having an issue where effects and key frames applied to both audio and video are not working, but only sometimes. Even after I render or export the video, the effects are not showing up. For example, trying to adjust volume using key-frames on some clips works fine, and not at all on others. The key-frames show up and I can see the volume changing in the effects panel, but it is not happening. Another example is changing the opacity on some video clips and it does not work sometimes. Same thing, I can see the key-frames and the values changing, but it's not actually happening. I have uninstalled and re-installed premiere pro and media encoder with no luck. I have uninstalled and re-installed the latest Nvidia drivers with no luck. Just to restate, this only happens on some clips and rendering or exporting the video does not help. My computer specs are:
    MSI GT60 Laptop:
    Intel Core i7 4800MQ (2.70GHz)
    16GB Memory 1TB HDD 128GB SSD
    NVIDIA GeForce GTX 880M 8GB
    2880 x 1620 16:9 3K Display
    Windows 8.1 64-Bit

    Here is the exact screenshot.  Now I'm also trying other effects as stated in my original post.  But this effect is just an example.  Is there really something that I'm doing wrong here?  Or am I forgetting something?  Is there some special "adobe doesn't let keyframes work on mpg's" rule or something silly like that?
    I wish that I could post a video, but I don't know how.
    Please let me know what I need to do to make this work properly.
    TEX

  • I HAD AN IPHONE AND DOWNLODED MANY PAID AND FREE APPS.MY IPHONE AND LAPTOP ARE NOT WORKING NOW.HOW DO I DOWNLOAD THE APPS INTO MY NEW LAPTOP SO THAT I CAN SYNC WITH MY NEW IPAD

    I HAD AN IPHONE AND I DOWNLOADED MANY PAID AND FREE APPS FROM ITUNES STORE.NOW MY IPHONE AND LAPTOP ARE NOT WORKING.HOW DO I GET THESE APPS INTO MY NEW LAPTOP SO THAT I CAN SYNC WITH MY NEW IPAD

    How to redownload purchased apps from the App Store

  • I tried updating software on my iphone and it did not work. My handset has had the picture of the usb cable asking to connect to itunes for hours and i can not switch my phone off or reset it. Please help!

    I tried updating iphone software and it did not work. It just shows connect to itunes with usb cable on the handset. I have tried for hours to try and turn the hanset off and troubleshoot but nothing works. The connect to itunes display can not be over-ridden.
    Please help!!!

    oh and the device is not being recognised by itunes now either.

  • I have the new ipad and tried to set up my work email and it did not work.Tried several times, what is wrong?

    I am trying to set up my work email on my new ipad3 and the exchange email is not working for me. What am I doing wrong?

    Make sure your work it folks are ok with the pad.  They can tell device type, and some companies simply don't want pads on their mail systems. ( yes, I know....)
    There is also usually another password entering the flow, your exchange password, that may be different than your normal password.  Give your friendly it guy a call.

Maybe you are looking for