Removing a movieclip from the stage after a set amount of time (or once it's finished its animation)

I've got a movieclip animation which is added to the stage at the start of the .swf.  Its an introduction to the game, and the user is encouraged to click on the movieclip to start the animation.
Once the animation is finished I'd like the movieclip to be removed from the stage.
How do I go about doing this?  Do I need to setup some sort of event handler which listens out if the movieclip has finished then start a function once its finished to remove it from the stage?  Which methods look out for movieclips finishing?
Cheers

there is no specific event that's called when a movieclip stops playing,
what you could do is inside your intro movieclip  dispatch an event as soon as the animation is finished
something like ... dispatchEvent(new Event("introFinished");
and all you have to do is add and event listener to the intro movieclip intro.addEventListener("introFinished", onIntroFinished);
when your onIntroFinished is called you can remove the intro from the stage.

Similar Messages

  • TypeError: Error #1006 - Removing MovieClip from the stage

    I have a movie clip that is called to the stage and once the movieclip is finished it calls a function that removes it from the stage. The code works but I get an error message about 4 seconds after the movie clip ends.
    Here’s the error message:
    TypeError: Error #1006: exitWordMicroscopic is not a function.
                    at ASvocabulary_microscopic/frame110()[ASvocabulary_microscopic::frame110:1]
    Here’s the stage code:
    //************************Removes the movieclip from the stage and enables the button.*************************
    function exitWordMicroscopic():void
                    bnt_vocab_microscopic.mouseEnabled = true;
                    removeChild(word_Microscopic);
    //******************************Stage buttons**************************************
    stage.addEventListener(MouseEvent.MOUSE_DOWN, goButtonsHomeRead_1);
    function goButtonsHomeRead_1(event:MouseEvent):void
                    //Vocabulary buttons
                    if (event.target == bnt_vocab_microscopic)
                                    bnt_vocab_microscopic.mouseEnabled = false;
                                    SoundMixer.stopAll();
                                    addChild(word_Microscopic);
                                    word_Microscopic.x = 47;
                                    word_Microscopic.y = 120;
    Here’s the code inside the movie clip. This is what the error message is referring to:
    //****************** Calls function to remove itself from the stage****************************
    Object(parent).exitWordMicroscopic();
    What am I doing wrong?

    Here' how the code looks now:
    Objective: To remove the current movieclip while it's playing so that it does not show on the next (or previous) frame.
    Here’s the stage code:
    var word_Microscopic:ASvocabulary_microscopic = new ASvocabulary_microscopic();
    //Removes the movieclip from the stage and enables the button.
    function exitWordMicroscopic():void
        bnt_vocab_microscopic.mouseEnabled = true;
        removeChild(word_Microscopic);
    //******************************Stage buttons**************************************
    stage.addEventListener(MouseEvent.MOUSE_DOWN, goButtonsHomeRead_1);
    function goButtonsHomeRead_1(event:MouseEvent):void
        //Vocabulary buttons
        if (event.target == bnt_vocab_microscopic)
            SoundMixer.stopAll();
            bnt_vocab_microscopic.mouseEnabled = false;
            addChild(word_Microscopic);
            word_Microscopic.x = 47;
            word_Microscopic.y = 120;
            word_Microscopic.play();
    //This button takes the user to the Main Screen
        if (event.target == bnt_ReadGoHome_1)
           // exitWordMicroscopic(); [If I use this function I get this error ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.]
            SoundMixer.stopAll();
            gotoAndPlay("1","Main");
            stage.removeEventListener(MouseEvent.MOUSE_DOWN, goButtonsHomeRead_1);
    //This takes the user to the next frame.
    if (event.target == GoNext_1)
            SoundMixer.stopAll();
            gotoAndPlay("2");
            stage.removeEventListener(MouseEvent.MOUSE_DOWN, goButtonsHomeRead_1);
    Here’s the code inside the movie clip.
    //****************** Calls function to remove itself from the stage****************************
    Object(parent).exitWordMicroscopic();

  • How do you remove a symbol from the stage in Edge animate?

    Hello-
    I'm wondering how to remove a symbol from the stage in Edge Animate so you can jump to another place in the timeline.  In Flash, the symbol was only on the stage for the amount of frames you indicated.  Not sure how it works here.
    For example, I have 2 buttons on my first screen with some text that animates in.  I want the button click to take the user to another section in the timeline or (basically another scene, like in Flash)  that contains different content.  If I change the visibility the buttons are still there and will ( I assume) create problems when other elements are placed on top. 
    Or is the only way with code.  If that is the case what would that code be?
    I would appreciate any help.
    Thank you!

    What I usually do, is, once you have everything set up in the scene you are done with. highlight it all
    right click
    group elements in DIV
    Now all those items act as 1 group and then you give it a properties name, much like a symbol.
    THEN you can refer to that scene name and move it anywhere or hide it and slide in another scene that has the content for that next scene.
    basically you take all the elements that make up 1 scene, gruop it up, name it, and then in the code for the button say something like:
    on click:
    scenename.play(framenumber);
    that will then animate that scene according to any animation you gave it, such as moving to the left, off stage. while moving scene 2 that you create into the stage.
    or just have something like this hide it
    sym.$("scenename").hide();
    sym.$("scene2name").show();
    but if you do that, make sure in your CompositionReady code you hide all scenes EXCEPT the 1st one, so the user doesnt see them all instanatly anyway.

  • I would like to know, on the ringtone page, where you can select songs out of your music library, is there a way to remove a song from the list after its selected? I would thin there would be a way to "delete" the songs from the list. (Clock app)

    I would like to know, on the ringtone page, where you can select songs out of your music library, is there a way to remove a song from the list after its selected? I would thin there would be a way to "delete" the songs from the list. (Clock app)
    Let me explain:
    In the clock app for ios 6.0.2 I am a little confused. It allows you to go into your music library, and create a ringtone using any songs you choose. However, I cannot find a way to remove a song from this list, just like I cannot delete one of the preset ringtones (which I'm not trying to do, but just as an example)
    Thanks for your time! If you need more information just ask.
    (I believe both my iPod and iTunes are up to date)

    I believe you just are able to delete them from iTunes.
    Hope it will be helpful

  • How do I remove a child from the stage using a button click?

    I have a movieclip that requires Play, Pause, Forward and Back buttons. The movieclip has actionscript at various frames to load movieclips from the library and repeat them.
    I have tried using a timeline scrubber but it does not trigger the actionscript when scrubbing, only when the movie plays normally.
    My possible solution is to create Fwd and Back buttons that can go to specific frames where key animations will begin.
    I need to develop actionscript that will remove Children when the user clicks Back.
    This is how I am loading several movieclips along the timeline from my library:
    var shpA1:arSHPp1;
    function attachAR1 () {
      shpA1 = new arSHPp1 ();
      shpA1.x = -30;
      shpA1.y = 18;
      addChild (shpA1);
    //the interval is used to repeat the animation to represent continuous flow on a diagram
    var myInterval1:uint = setInterval (attachAR1, 500);
    This what I have tried so far (not working at all - no errors or trace):
    function remChild1(event:MouseEvent) :void {
        if(shpA1.stage)
            trace("arSHPp1 is in display list");
            shpA1.parent.removeChild(shpA1);
            shpA1 = null
        else
            trace("arSHPp1 isn't in display list");

    I did try that but it would not remove the child.
    i appreciate your help though.
    I am also trying to determine if a child is on the stage and if it is, remove it. I have created a button that will jump back on the timeline and the mc's that were loaded after this point in time.
    This looks like it should work. It doesn't give me any errors but the mc remains on the stage.
    var remMC;
    if (getChildByName("mc2") != null) {
      removeChild(mc2);

  • How do you remove voice memos from the iPod after downloading it to iTunes?

    first of all, which model of voice recorder is best for the 5G video 30 gb iPod? I have heard of Griffin iTalk and Belkin Universal Microphone Adapter, but i'm leaning towards the iTalk b'c it looks cheaper on Amazon and eBay. does anyone suggest anything along those lines?
    and also, after recording voice memos (like class lectures and such) onto the iPod and downloading them to iTunes, how do i remove them from the iPod? do i have to make them a different program file (like windows media player, and not iTunes)?
    Compaq Presario   Windows XP   2001

    Hi King Arthur 2000,
    Voice memos can be shared back to a computer in a number of different ways, described in this article -
    Share a voice memo - Voice Memos - iPhone Basics - Apple Support
    http://support.apple.com/kb/TI227
    Thanks for using Apple Support Communities.
    Best,
    Brett L

  • Removing UI Loader from the stage

    I have 5 GoToframe activated UI loaders that appear on stage when a btn is clicked. All work fine except when either video galleries are clicked (there are two) . After the video gallery appears on stage any button clicked after that adds the next UI loader but the video gallery remains playing.
    Do I use a removeEventListener?
    Do I use on all buttons?
    Create separate functions?
    Any help which code and where to put????
    here is the code to one of the galleries
    this.stop();
    btnGallImg.addEventListener(MouseEvent.CLICK, vgall2);
    function vgall2(evt:Event):void {
        gotoAndStop("gallery2");

    you need to explicitly stop the video stream in the loaded swf.  how you do that depends on how the stream is started.
    for example, if you're using an flvplayback component with instance name flv, and your uiloader has instance name uiLDR, you could use:
    MovieClip(uiLDR.content).flv.stop()

  • My time capsule loses connection to the internet after a short amount of time. It works for 1-2 minutes then stops, any suggestions?

    I just replaced a generation 1 time capsule with the brand new 3TB TC version.   I connected it and did all of the restarts and even called apple and spent over and hour and we simply couldnt figure it out.   Right when the devices (modem and router) are done re-booting I receive green lights in airport utility on both the base stattion TC and the internet. The internet is screaming fast and I am able to go to new websites.  Then after just a couple minutes (1-2) the internet light switches from green to amber and I drop my connection.   I feel like I have tried everything but it keeps losing the connection.   Any suggestions?

    Exactly what modem are you using?
    And what mode is the TC running in and how is it connected and what mode does it work in?

  • Firefox will open but not load any new tabs or windows after a set amount of time.

    After about a day of my computer running, Firefox will stop being able to browse the web at all. Any attempt to open a new window, tab, or refresh an old tab will result in the program not doing anything, or opening a new window/tab with (Untitled) in it. The window cannot be navigated away from this, and will not refresh. Closing Firefox does not solve the problem, nor does ending the process. The only way to restore Firefox's functionality is to restart my machine.

    hello spitcher, other users with this problem all had an embedded intel hd3000 graphics card with an old driver present. in case this also applies to you, here would be a link to update the driver, which in turn should also address the black firefox problem: https://downloadcenter.intel.com/Detail_Desc.aspx?DwnldID=23764 (for win7 64 bit)
    in case this doesn't solve the issue or does not apply to your system, start firefox into safemode '''by pressing the shift key while the application is launching''' & disable hardware acceleration in the firefox ''menu ≡ > options > advanced > general'' (that setting will take a restart of the browser to take effect).
    [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]]

  • Is there a way to create a user account that "expires", or self deletes itself after a set amount of time?

    I am hoping to find a way to create an Admin account for our parent body that can be used for items at home, "adding printers, software, wireless settings, etc...), but have that account either "expire" or self delete itself after say 72 hours?
    Thoughts?
    Jesse

    Will they be needing to keep files saved for a while?  I'm guessing no, since you're ok with it auto-deleting after a short while.
    You could just use the guest user:  http://support.apple.com/kb/PH11321
    But I'm not aware of any way that you could setup an account to expire.

  • How to remove a dynamic symbol from the stage?

    I'm loading dynamically copies of a Library symbol with a button click. Question is, when I move around in the timeline, I don't want to see the symbols at certain points. Can I loop through the json file and remove each symbol from the stage? Or is there a better way of accomplishing this?
    Being new to Edge Animate, I'm also unsure as to the names of the symbols as they are placed on the stage. If I use the browser's developer tools, I can see that the divs are named Stage_90, Stage_91, Stage_92 etc. However doing something like the following does not seem to work:
    sym.$("Stage_90").hide();
    I appreciate the help. Thanks again.

    I got it. It should be:
    $("#region1").remove();  
    // # was missing.
    I actually added that to time 0 on the main timeline so when I got back there it removes the image.
    It's not working from the symbol yet but I guess I should eventually get it working from there instead.
    Thanks for your time.

  • How do I remove a photo from the trash that I brought forward from Time Machine?

    How do I remove a photo from the trash that I brought forward using Time Machine?

    Have you tried to normal way. Highlight the photo in the Trash/Right Click: Put Back.  Or just drag it back into Events.

  • Randomly generating movieClips from the library onto the stage

    Hi
    I am trying to call objects from the library for a collection game.
    Having major issues with the best way to assign the good objects and the bad objects to later update a score.
    Can anyone help me with how i can first assign the movieClips from the library into a good and bad array and then after randomally fill the stage with them.
    Regards
    James

    again and always when testing in the ide, use the trace() function to debug your code:
    public function checkCollisions()
                                  for (var i:int = objects.length - 1; i >= 0; i--)
                                            if (Point.distance(new Point(gamesprite.car.x,gamesprite.car.y),new Point(objects[i].x,objects[i].y)) < pickupDistance)
                                                      if (objects[i].hitTestobjects(gamesprite.car))
                                                                if (objects[i].typestr == "good")
                                                                          score +=  10;
                                                                          trace(score);
                                                                else
                                                                          score -=  4;
                                                                          trace(score);
                                                                if (score < 0)
                                                                          score = 0;
                                                                scoreDisplay.text = String(score);
    trace(scoreDisplay.text);
                                                                removeChild(objects[i]);
                                                                objects.splice(i,1);
    if you don't see any trace() output, you can conclude that part of your code is not executing.  if see trace output, you can don't see the same value in scoreDisplay, you can conclude you're not seeing your scoreDisplay textfield.

  • How to effectively remove a loaded SWF from the stage?

    I can not figure out a proper coding to remove a loded SWF from the stage.
    Here is my set up.
    I have a layout segmented into labeled section. In the section labeled "products" I have a layout consisting of product images acting as buttons which bring a user to another labeled section "prdctsPopUps"
    In the "prdctsPopUps" section I have placed an instance of LoaderMax placed into an mc container. Placing LoaderMax into an mc container automatically resolved an issue of clearing loaded SWFs from stage when I come back to "products" section.
    I specified the variable in the "products" section with the following set up:
    var sourceVar_ProductsPopUps:String;
    function onClickSumix1PopUp(event:MouseEvent):void {
                        sourceVar_ProductsPopUps="prdcts_popups/sumix1-popup_tl.swf";
                        gotoAndPlay("prdctsPopUps");
    So each button has its own "....swf" URL and they all open fine and I can come back to "products" section without any issues.
    However inside the swf (which loads through LoaderMax which is placed into an mc) there are other buttons which bring a user to labeled section "xyz". Which also functions properly. It opens as it is supposed to be and without any previously loaded "...swf" on the stage.
    At the labeled section "xyz" there is a limited set of buttons repeating from section "products" which has to bring a user back to the same set up in the "prdctsPopUps" labeled section and open a corresponding "...swf" .
    However only the last opened "...swf" will appear in that section. Effectively the one which was originally opened from the "prdctsPopUps" section and not the one which was supposed to be opened from the "xyz" section.
    I can not understand why it would work from one labeled section and not from another. I can not figure out on which section which code/function needed to be placed.
    Here is the set up from a button from the "xyz" section whcih supposed to bring a user to the same "prdctsPopUps" section but to load a different "...swf"
    var sourceVar_ProductsPopUps_fromXYZ:String;
    function onClick_floralytePopUp_fromXYZ(event:MouseEvent) :void {
                        sourceVar_ProductsPopUps_fromXYZ="prdcts_popups/floralyte-popup_tl.swf";
                        gotoAndPlay("prdctsPopUps");
    Here is the code set up for the LoaderMax from the "prdctsPopUps" section:
    var loaderProductPopUps:SWFLoader = new SWFLoader(sourceVar_ProductsPopUps,
                                                                                                        estimatedBytes:5000,
                                                                                                        container:holderMovieClip,
                                                                                                        onProgress:progressHandler,
                                                                                                        onComplete:completeHandler,
                                                                                                        centerRegistration:true,
                                                                                                        alpha:1,
                                                                                                        scaleMode:"none",
                                                                                                        width:540,
                                                                                                        height:730,
                                                                                                        crop:true,
                                                                                                        autoPlay:false
    function progressHandler(event:LoaderEvent):void{
              progressBarPopUp_mc.gradientbarPopUp_mc.scaleX = loaderProductPopUps.progress;
    function completeHandler(event:LoaderEvent):void{
              var loadedImage:ContentDisplay = event.target.content;
              TweenMax.to(progressBarPopUp_mc, 1.5, {alpha:0, scaleX:0.25, scaleY:0.25});
    loaderProductPopUps.load();
    Is there something which needs to be imported, or specific function needs to be specified in a specific labeled section?

    actually, i think you'll need to use something like:
    var loaderProductPopUps:SWFLoader;
    if ((loaderProductPopUps){
    if(loaderProductPopUps.content)){
       loaderProductPopUps.unload();
    loaderProductPopUps= new SWFLoader(sourceVar_ProductsPopUps, //the value of sourceVar_ProductsPopUps allows to load mulitple SWFs from the products page.
                                                                                                         estimatedBytes:5000 ,
                                                                                                         container:holderMov ieClip,// more convinient and easier to manage if to place the LoaderMax into an empty mc (holderMovieClip)
                                                                                                                                                                         // if not will work as well. Then the line container:holderMovieClip, has to be replaced with container:this,
                                                                                                                                                                         // can be any size, can not be scaled as it distorts the content
                                                                                                         onProgress:progress Handler,
                                                                                                         onComplete:complete Handler,
                                                                                                         centerRegistration: true,
                                                                                                         //x:-260, y:-320, //no need for this is if used: centerRegistration:true,
                                                                                                         alpha:1,
                                                                                                         scaleMode:"none",
                                                                                                         //scaleX:0, scaleY:0,
                                                                                                         //vAlign:"top",
                                                                                                         width:540,
                                                                                                         height:730,//scales proportionally but I need to cut off the edges
                                                                                                         crop:true,
                                                                                                         autoPlay:false
    function progressHandler(event:LoaderEvent):void{
              progressBarPopUp_mc.gradientbarPopUp_mc.scaleX = loaderProductPopUps.progress;
    function completeHandler(event:LoaderEvent):void{
              var loadedImage:ContentDisplay = event.target.content;
              //TweenMax.to(loadedImage, 1.5, {alpha:1, scaleX:1, scaleY:1});//only need this line if corresponding values are changed in SWF loader constructor
              TweenMax.to(progressBarPopUp_mc, 1.5, {alpha:0, scaleX:0.25, scaleY:0.25});
    loaderProductPopUps.load();

  • IPhoto for iOS removes the GPS exif data from the photo after an edit

    iPhoto for iOS removes the GPS exif data from the photo after an edit
    Using the iPhone camera, I take a photo and then I want to make the photo a little brighter.
    So, I edit a photo using iPhoto for iOS and then save the photo back to the camera roll.
    Now, I might want to see where that photo was taken via another app (like Photo Mapo) or on the map using the Photos app, or even the Mac iPhoto app.
    However, the GPS data has been removed. Looks like all of the other exif data is still in the photo.
    Why not just have a feature to remove the GPS data if the user wants? no reason to remove it for them.
    The user explictily chose to have location services turned on so the GPS data would be in the photo.
    Is this a bug?
    Thanks,
    Brian.

    First thing to try is a reboot of your iPad. Press and hold the Home and Sleep buttons simultaneously ignoring the red slider until the Apple logo appears. Let go of the buttons and let the iPad restart. See if that fixes your problem.
    None of my cameras has a GPS function so I never see that data in the info of a photo in iPhoto for iOS. But I do see the map choice to set a location for the photo. Perhaps a reboot will fix this for you.

Maybe you are looking for

  • How can I do a loop within a select statement

    This is my query Select distinct s.First_NM, s.Last_nm, s.Date_of_birth, i.Class_ID, i.Enrollment_begn_dt, i.Enrollment_end_dt, SUBSTR(TO_CHAR(i.Enrollment_begn_dt, 'MMDDYYYY'),1,2) AS MONTH, SUBSTR(TO_CHAR(i.Enrollment_end_dt, 'MMDDYYYY'),5,4) AS YE

  • "max-pool-size"   what is it good for?

    SCreator simple CRUD use: After a while I get: " Error in allocating a connection. Cause: In-use connections equal max-pool-size and expired max-wait-time. Cannot allocate more connection" Which is odd, because its just me using the server/database.

  • Upgrade again.. but w/o DVD drive:-)

    Hi, +/* Sorry to bother the community with maybe same question: I see many regarding upgrades. Unfortunately I didn't find a solution for my particular situation, so here it goes again ...+ 1) I have a G5 with 10.3.9; need to upgrade to a higher v-n

  • Problem importing Address Book to new OS

    I recently upgraded my macbook pro from leopard to snow leopard. I backed up all my data to an external hard drive. I did not archive address book. How can I import my address book data to my new OS?

  • Sorting table combine with Assending n DESCENDING  value

    Dear All ... i want to sort by table  with some field.  which some of the field in assending  n some in desending. example: this my table itab .              1.1.09       a            H               1.1.09       c            H              1.1.09