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();

Similar Messages

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

  • Problem removing Objects from the stage in Flash CS4 (AS3.0)

    I have a problem with this code:
    this.addEventListener(Event.ENTER_FRAME, vanish);
    function vanish(event:Event):void{
         if(character_mc.hitTestObject(vanish_mc)){
              vanish_mc.parent.removeChild(vanish_mc);
    There are two overlapping objects on my stage: character_mc and vanish_mc.
    As soon as i start the scene[Ctrl+Enter] vanish_mc is VISUALLY removed. But the code still sees a collision somehow. How can i Entirely remove the object vanish_mc?
    Thank you for help and advice.

    Ah I think the problem is what my problem not which I proposed, my bad I was trying to keep it simple.
    the remove code in my problem actually looks like this:
    if(character_mc.hitTestObject(this["dollar_mc_"+String(i)])){
         removeChild(this["dollar_mc_"+String(i)]);
    I wanted it to be that way so I could add infinite "dollar_mc_" ' s without writing myself to death with code and or getting confused.
    Imagine it like a game where a character it picking up dollars, which would disappear once they intersect.
    And that exactly is what gives me that argument.
    Do you know a way i could write this code, or do you suggest to leave it that way...because it does run and work im just getting this argument while debugging.
    Thank you for all the help~

  • All FLV files have removed themselves from the stage

    Hey Folks
    All my FLV Files are no longer on the stage where they had
    been placed. I moved the folder do I need to relink the paths and
    tell the program where all the FLVs are now? (like in final cut
    pro?) how would I do that if so....
    thanks
    n

    Boy my first answer was dumb.
    Are you using Flash 8? If so you should still see the FLV
    Components on the stage. Click on the FLV Playback component and
    open up the component inspector. YOu will need to adjust the paths
    for the contentPath. When you click on the flv file name a
    magnifying glass should appear next to it. Click on that and browse
    to the new flv location.

  • 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);

  • Removing Movieclips from an Array Displayed on stage

    Hi Everyone ,
    I am new to AS3 so please forgive me in advance if I end up annoying anyone ;(
    I need some help in removing Movie Clips from the stage , these were initially loaded off an array
    Here is the Code with the NEXT Button , : for both ARRAYS , Notes and Notes15 ( referring to 15th frame)
    function nextframepop2(Event:MouseEvent):void{
    trace("Mouse Enabled");
    removeChild(notes15[4]);
    removeChild(notes15[3]);
    removeChild(notes15[2]);
    removeChild(notes15[1]);
    removeChild(notes15[0]);
    nextFrame();
    function nextframepop1(Event:MouseEvent):void{
    trace("Mouse Enabled");
    removeChild(notes[1]); // This is Line 635 , but I am not sure what I am doing wrong here.
    removeChild(notes[0]);
    nextFrame();
    I am calling this Function with an If Statement , I need to make sure all the Movie Clips are loaded before the End User decides to move to next slide.
    Here is what I get when I run the Next Button ,
    ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
    at flash.display::DisplayObjectContainer/removeChild()
    at PORTDemoPresent_fla::MainTimeline/nextframepop1()[PORTDemoPresent_fla.MainTimeline::frame 2:635]
    Can anyone please help ?

    Based on what you show it is likely that some other function (like the one before it as shown) has already removed the object.  What you should do is learn to use the trace function to troubleshoot your code.  In this case put in a trace anywhere you add or remove the same object that tells you whether it is added or removed and which line of code it is, realizing that you might be storing the same object with different references to it.  That way you should be able to isolate where things are being removed when you don't expect them to be.

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

  • 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();

  • I am getting an error message while managing my cloud it says "cannot turn off backup" when i want to remove apps from the clous. how do i fix?

    i am getting an error message while managing my cloud it says "cannot turn off backup" when i want to remove apps from the clous. how do i fix?

    Hey ktillis88,
    Thanks for the question. Based on the information you have provided, the following resource may be helpful:
    iCloud: Understanding Backup alert messages
    http://support.apple.com/kb/TS4576
    "Backups for appname cannot be turned off at this time."
    This message occurs if disabling Backup for an app on your iOS device does not complete successfully. Wait a few minutes and then attempt to disable Backup for the app again. If you continue to receive this alert, contact iCloud Support for assistance.
    Thanks,
    Matt M.

  • [svn] 4233: When an FxComponent is removed from the stage and then re-added , we no longer reload the associated Skin unless it is absolutely necessary .

    Revision: 4233
    Author: [email protected]
    Date: 2008-12-04 12:15:28 -0800 (Thu, 04 Dec 2008)
    Log Message:
    When an FxComponent is removed from the stage and then re-added, we no longer reload the associated Skin unless it is absolutely necessary.
    Bug Notes: None
    QE Notes: None
    Doc Notes: None
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxComponent.as

    please let me know the linksys device model number you are using ..

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

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

  • [svn:fx-trunk] 10826: When a Video is removed from the stage or becomes invisible, the video will now pause playback.

    Revision: 10826
    Author:   [email protected]
    Date:     2009-10-02 10:28:43 -0700 (Fri, 02 Oct 2009)
    Log Message:
    When a Video is removed from the stage or becomes invisible, the video will now pause playback.  This features is controlled through a new property, playWhenHidden, which defaults to false (meaning we don't play the video when it's hidden).  When it becomes visible/on-stage again, we will start playing the video if autoPlay=true.  Otherwise, the video will not automatically start playback.
    This property still needs to be reviewed by PARB.
    Also, updating a comment in SkinnableContainer relating to a FIXME I own.
    QE notes: -
    Doc notes: -
    Bugs: SDK-21928
    Reviewer: Deepa
    Tests run: checkintests, mustella VideoElement/VideoPlayer
    Is noteworthy for integration: Yes
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-21928
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/SkinnableContainer.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VideoPlayer.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/VideoElement.as

    Is this the same trouble you are having?
    http://discussions.apple.com/thread.jspa?threadID=826805&tstart=0
    DP G5 2GHz    

  • I need to remove a library item from the stage

    Right now I have a button that brings a library symbol to the stage. Ideally, I want to be able to click on the symbol itself to make itself from the stage. Can anyone help me with this?

    for example:
    var sym:WhateverClass=new WhateverClass();
    sym.addEventListener(MouseEvent.CLICK,clickF);
    function clickF(e:MouseEvent):void{
    e.currentTarget.parent.removeChild(e.currentTarget);

  • Deleting objects from the stage

    Hi all,
    I've got some items on my stage that I'm removing with
    RemoveChild(). The items no longer show, however, as stated in
    LiveDocs, the item is not actually destroyed. This means any
    bindings/listeners created by that object are still in existence
    and are creating errors (Specifically, I'm getting "The supplied
    DisplayObject must be a child of the
    caller").
    LiveDocs mentions that if I want to actually delete an object
    from the stage entirely, I should use the "delete operator", but
    for the life of me, I can not find any documentation on the
    existence of such an operator. Any advice would be much
    appreciated.
    -Hob

    It IS ridiculously hard to find. Searcing Live Docs for
    delete oprator will turn up a slew of hits, but which is the right
    one?
    This is from old docs, but it is still valid:
    http://livedocs.adobe.com/flash/8/main/00001865.html
    Tracy

Maybe you are looking for

  • 8.1 update bricked 4s

    Hi Updated iTunes - 12.0.1.26 - on Win 7 pc - iTunes offered to update my 4S to IOS8.1. During the update there were error messages: initially the process stopped and offered to update or roll back - iPhone was on 7.1.2, I believe. Second message sim

  • Page item field placement in report region

    I have a report region that has item fields in it. Additionally I have a page item field that I can only display above left of the report region. Question: how can I move the page item to middle area above region and how do I associate it's value wit

  • Need to create a user  from procedure

    Hi to all, I need to create a user from oracle stored procedure. i am able to create a proceure successfully, when i am executing the procedure i cant able to successfully run it. it is throwing insufficient privileges. i tried to run the procedure f

  • Compiling Enterprise JavaBeans and Its Interfaces

    I've downloaded j2sdk1.4.1_02 and can't compile any code that imports javax.servlet.* and javax.servlet.http.* The install ZIP file has a JAVAX directory but no SERVLET or SERVLET.HTTP subdirectory. What's the going on? Am I missing some isoteric poi

  • Can I use Nav Attribute of a Nav Attribute for Drill Down....??

    Hello Gurur: I have a strange request.  We need to use 0EMPLOYEE in our Cube, whic has 'Comp. Code', 'Cost Center' 'User ID' as Nav Attributes.  "Com Pcode" has Nav attributes 'Global Divison" "Subsidiary" etc. We need to use the 'Global Division' if