How can I get the reset button to work?

When you click on the reset button, this error below comes up. If you can't find the button it is the navy colored rectangular thing in the lower left corner of page.
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
    at flash.display::DisplayObjectContainer/removeChild()
    at AddATree2/onReset()
Here is the code:
THERE IS AN ATTACHED .FLA AND 3 AS FILES, RESET, TREE, AND ADDATREE2
Appreciate your thoughts!  w_sights
ADDATREE2.AS
/* AS3
    Copyright 2008 __MyCompanyName__.
package
     *    Class description.
     *    @langversion ActionScript 3.0
     *    @playerversion Flash 9.0
     *    @author
     *    @since  19.05.2009
    import flash.display.Sprite;
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    import flash.events.Event;
    import flash.utils.Timer;
    import flash.text.TextField;
    import flash.text.TextFormat;
    import flash.text.StyleSheet;
    import Reset;
    import Tree;
    public class AddATree2 extends MovieClip {
        // CLASS CONSTANTS
         //  CONSTRUCTOR
         *    @Constructor
        public function AddATree2(){
            reset.addEventListener( MouseEvent.CLICK, onReset ) ;
            reset.buttonMode = true ;
            reset.mouseChildren = false;
            mcAdd.addEventListener ( MouseEvent.CLICK , onClick ) ;
            mcAdd.buttonMode = true ;
            mcAdd.mouseChildren = false;
            //var reset_btn:reset = new reset();
        //  PRIVATE VARIABLES
            private var clickCount:Number = 0;
        //  PUBLIC VARIABLES
            public var reset:MovieClip = new MovieClip();
        //  GETTER/SETTERS
        //  PUBLIC METHODS
        //  EVENT HANDLERS
        private function onClick ( evt : MouseEvent ) : void
            clickCount++;
            switch(clickCount)
                case 1:
                        var tree = new Tree ( ) ;
                        addChild ( tree ) ;
                        tree.x = 430;
                        tree.y = 300;
                        tree.scaleX = .95;
                        tree.scaleY = .95;
                        var brickham:BrickhamScriptProBMP = new BrickhamScriptProBMP();
                        var fmt:TextFormat = new TextFormat();
                        fmt.font =  brickham.fontName;
                        fmt.size = 58;
                        /*var regularText:TextField =  new TextField();
                        regularText.autoSize = "left";
                        regularText.embedFonts = true;
                        regularText.defaultTextFormat = fmt;
                        //regularText.text = "Merry Christmas"
                        addChild(regularText);
                        var css:StyleSheet = new StyleSheet();
                        css.setStyle("p", {fontFamily:brickham.fontName, fontSize:78,color:"#FFFFFF"});
                        //css.setStyle("a", {textDecoration:"underline"});
                        var webText:TextField = new TextField();
                        webText.autoSize = "left";
                        webText.embedFonts = true;
                        webText.styleSheet = css;
                        webText.htmlText = "<p>Merry Christmas</p>";
                        webText.x = 52;
                        webText.y = 41;
                        addChild(webText);
                        break;
                case 2:
                        var tree2 = new Tree();
                        addChild(tree2);
                        tree2.x = 175;
                        tree2.y = 450;
                        tree2.scaleX = .65;
                        tree2.scaleY = .65;
                        break;
                case 3:
                        var tree3 = new Tree();
                        addChild(tree3);
                        tree3.x = 45;
                        tree3.y = 365;
                        tree3.scaleX = .45;
                        tree3.scaleY = .45;
                        break;
           /*     case 4:
                        var tree4 = new Tree();
                        addChild(tree4);
                        tree4.x = 660;
                        tree4.y = 195;
                        tree4.scaleX = .25;
                        tree4.scaleY = .25;
                        break;
        //mcAdd.removeEventListener ( MouseEvent.CLICK , onClick ) ;
        //  PRIVATE & PROTECTED INSTANCE METHODS
        /*reset_btn.addEventListener(MouseEvent.CLICK, resetButton);*/
        function onReset(event:MouseEvent)
            var webText:TextField = new TextField();
            var reset:MovieClip = new MovieClip();
            reset.x = 450;
            reset.y = 500;
            reset.scaleX = .01;
            reset.scaleY = .01;
            addChild(reset);
            stage.addEventListener(MouseEvent.CLICK, removeWebText);
            var tree = new Tree();
            removeChild(tree);
            var tree2 = new Tree();
            removeChild(tree2);
            var tree3 = new Tree();
            removeChild(tree3);
        public function removeWebText(event:MouseEvent):void
            var webText:TextField = new TextField();
            var fmt:TextFormat = new TextFormat();
            removeChild(webText);
TREE.AS
package
    import flash.display.MovieClip;
    import flash.events.Event;
    public class Tree extends MovieClip
        function Tree()
            addEventListener ( Event.ADDED_TO_STAGE , onAddedToStage ) ;
        private function onAddedToStage ( evt : Event ) : void
            width = stage.stageWidth ;
            height = stage.stageHeight ;
RESET.AS
package
    import flash.display.MovieClip;
    import flash.events.Event;
    public class Reset extends MovieClip
        function Reset()
            addEventListener ( Event.ADDED_TO_STAGE , onAddedToStage ) ;
        private function onAddedToStage ( evt : Event ) : void
            width = stage.stageWidth ;
            height = stage.stageHeight ;

Hello:
Thank you for responding so quickly.
I have added child and it has removed the error. However, the button icon has disappeared as you can see when you play the .swf and the reset button doesn't clear the stage of everything but the star and the back ground.
See new code:
/* AS3
    Copyright 2008 __MyCompanyName__.
package
     *    Class description.
     *    @langversion ActionScript 3.0
     *    @playerversion Flash 9.0
     *    @author
     *    @since  19.05.2009
    import flash.display.Sprite;
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    import flash.events.Event;
    import flash.utils.Timer;
    import flash.text.TextField;
    import flash.text.TextFormat;
    import flash.text.StyleSheet;
    import Reset;
    import Tree;
    public class AddATree2 extends MovieClip {
        // CLASS CONSTANTS
         //  CONSTRUCTOR
         *    @Constructor
        public function AddATree2(){
            reset.addEventListener( MouseEvent.CLICK, onReset ) ;
            reset.buttonMode = true ;
            reset.mouseChildren = false;
            mcAdd.addEventListener ( MouseEvent.CLICK , onClick ) ;
            mcAdd.buttonMode = true ;
            mcAdd.mouseChildren = false;
            //var reset_btn:reset = new reset();
        //  PRIVATE VARIABLES
            private var clickCount:Number = 0;
        //  PUBLIC VARIABLES
            public var reset:MovieClip = new MovieClip();
        //  GETTER/SETTERS
        //  PUBLIC METHODS
        //  EVENT HANDLERS
        private function onClick ( evt : MouseEvent ) : void
            clickCount++;
            switch(clickCount)
                case 1:
                        var tree = new Tree ( ) ;
                        addChild ( tree ) ;
                        tree.x = 430;
                        tree.y = 300;
                        tree.scaleX = .95;
                        tree.scaleY = .95;
                        var brickham:BrickhamScriptProBMP = new BrickhamScriptProBMP();
                        var fmt:TextFormat = new TextFormat();
                        fmt.font =  brickham.fontName;
                        fmt.size = 58;
                        /*var regularText:TextField =  new TextField();
                        regularText.autoSize = "left";
                        regularText.embedFonts = true;
                        regularText.defaultTextFormat = fmt;
                        //regularText.text = "Merry Christmas"
                        addChild(regularText);
                        var css:StyleSheet = new StyleSheet();
                        css.setStyle("p", {fontFamily:brickham.fontName, fontSize:78,color:"#FFFFFF"});
                        //css.setStyle("a", {textDecoration:"underline"});
                        var webText:TextField = new TextField();
                        webText.autoSize = "left";
                        webText.embedFonts = true;
                        webText.styleSheet = css;
                        webText.htmlText = "<p>Happy Happy</p>";
                        webText.x = 52;
                        webText.y = 41;
                        addChild(webText);
                        break;
                case 2:
                        var tree2 = new Tree();
                        addChild(tree2);
                        tree2.x = 175;
                        tree2.y = 450;
                        tree2.scaleX = .65;
                        tree2.scaleY = .65;
                        break;
                case 3:
                        var tree3 = new Tree();
                        addChild(tree3);
                        tree3.x = 45;
                        tree3.y = 365;
                        tree3.scaleX = .45;
                        tree3.scaleY = .45;
                        break;
           /*     case 4:
                        var tree4 = new Tree();
                        addChild(tree4);
                        tree4.x = 660;
                        tree4.y = 195;
                        tree4.scaleX = .25;
                        tree4.scaleY = .25;
                        break;
        //mcAdd.removeEventListener ( MouseEvent.CLICK , onClick ) ;
        //  PRIVATE & PROTECTED INSTANCE METHODS
        /*reset_btn.addEventListener(MouseEvent.CLICK, resetButton);*/
        function onReset(event:MouseEvent)
            var webText:TextField = new TextField();
            var reset:MovieClip = new MovieClip();
            reset.x = 450;
            reset.y = 500;
            reset.scaleX = .01;
            reset.scaleY = .01;
            addChild(reset);
            stage.addEventListener(MouseEvent.CLICK, removeWebText);
            var tree = new Tree();
            addChild(tree)
            var tree2 = new Tree();;
            addChild(tree2);
            var tree3 = new Tree();
            addChild(tree3);
            removeChild(tree);
            removeChild(tree2);
            removeChild(tree3);
        public function removeWebText(event:MouseEvent):void
            var webText:TextField = new TextField();
            var fmt:TextFormat = new TextFormat();
            addChild(webText);
            removeChild(webText);
===============
TREE.AS
package
    import flash.display.MovieClip;
    import flash.events.Event;
    public class Tree extends MovieClip
        function Tree()
            addEventListener ( Event.ADDED_TO_STAGE , onAddedToStage ) ;
        private function onAddedToStage ( evt : Event ) : void
            width = stage.stageWidth ;
            height = stage.stageHeight ;
RESET.AS
package
    import flash.display.MovieClip;
    import flash.events.Event;
    public class Reset extends MovieClip
        function Reset()
            addEventListener ( Event.ADDED_TO_STAGE , onAddedToStage ) ;
        private function onAddedToStage ( evt : Event ) : void
            width = stage.stageWidth ;
            height = stage.stageHeight ;

Similar Messages

  • Answer: to How can I get the reset button to work.

    How can I get the reset button to work?: Answer
    Thanks to everyone who helped on this. You are awesome. Especially Ned!!  Posted here because I was unable to add more to the existing post.
    Here is the question:
    When you click on the reset button, this error below comes up. If you can't find the button it is the navy colored rectangular thing in the lower left corner of page.
    ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
        at flash.display::DisplayObjectContainer/removeChild()
        at AddATree2/onReset()
    When you click on the reset button, this error below comes up. If you can't find the button it is the navy colored rectangular thing in the lower left corner of page.
      Here is the answer:
    //when you click the reset button everything is removed from the stage
        //except the star, baclground, and reset button (trees and greeting REMOVED)
        public function onClear(Event:MouseEvent):void
                if (tree3) removeChild(tree3);
                if (tree2) removeChild(tree2);
                if (webText) removeChild(webText);
                if (tree) removeChild(tree);
                clickCount = 0;

    This is the answer to what to put in the onclear function.

  • In Yosemite, How can I get the "READER" button back in the Tool Bar at the top of the screen

    In OS X Yosemite,
    How can I get the "READER" button back in the Tool Bar for Safari at the top of the screen ?
    Thanks,

    I don't see the "READER button".
    I see "READ LATER" but not the "READER" function.
    Maybe I'm doing it wrong.
    Please continue to HELP ME with this question.
    In the previous version of Safari, there was a "READER Button" on the right side of the tool bar. This brings up the selected web page in a READER mode all by itself, without the ads, etc.
    Are you saying that I can get this function by clicking on the Left side of the Address bar?
    When I do that, I get lots of icons, but NOT the READER button.
    Thanks

  • How can I get my home button to work again

    How can I get my home button to work again

    Well, if your Home button is broken, you won't be able to reset your phone, and if the Sleep/Wake button won't turn your phone on, it's a trip to the Apple store.

  • I have Windows 7 and PS Elements 10 and can't get the text button to work properly.  What can I do?

    I have Windows 7 and PS Elements 10 and can't get the text button to work properly.  What can I do?

    Try selecting the T tool and then doing a reset (see image below)

  • How can you get the apple tv to work in a hotel where to get on the wifi you have to still go to a website first and put in your room

    How can you get the apple tv to work in a hotel where to get on the wifi you have to still go to a website first and put in your room?

    Welcome to the Apple Community.
    Unfortunately the Apple TV doesn't have a web browser so you can't do that.

  • I purchased Adobe Acrobat x Pro recently and installed it, I have compatibility issues vision 2013. The adobe pdf converter  plug in stays inactive despite all my efforts to activate it, I need help with this? How can i get the plug in to work with Visio

    I purchased Adobe Acrobat x Pro recently and installed it, I have compatibility issues vision 2013. The adobe pdf converter  plug in stays inactive despite all my efforts to activate it, I need help with this? How can i get the plug in to work with Visio 2013?

    For MS Visio (any version) only the appropriate version of Acrobat *PRO* provides PDFMaker for Visio.
    For Visio 2013 specifically you must have Acrobat XI Pro (updated to at least 11.0.1).
    See: 
    http://helpx.adobe.com/acrobat/kb/compatible-web-browsers-pdfmaker-applications.html  
    Be well...

  • How can I get the right click to work in firefox -- it works in internet explorer

    how can I get the right click to work in firefox -- it works in interne

    Try the Firefox SafeMode to see how it works there. <br />
    ''A troubleshooting mode, which disables most Add-ons.'' <br />
    ''(If you're not using it, switch to the Default Theme.)''
    * You can open the Firefox 4/5/6/7 SafeMode by holding the '''Shft''' key when you use the Firefox desktop or Start menu shortcut.
    * Or use the Help menu item, click on '''Restart with Add-ons Disabled...''' while Firefox is running. <br />
    ''Don't select anything right now, just use "Continue in SafeMode."''
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before using the Firefox shortcut (without the Shft key) to open it again.''
    If it is good in the Firefox SafeMode, your problem is probably caused by an extension, and you need to figure out which one. <br />
    http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes

  • How can I get the readability bookmarklet to work

    Firefox 3.6.8 in Windows XP Home on a Toshiba netbook. How can I get the "readability" bookmarklet to work? It works just fine in Camino on an Apple mini desktop computer running OS X 10.4.11 (Tiger.) Readability uses javascript, which I do have turned on. The problem (of it not working) doesn't seem to have anything to do with the NoScript add-on either, as I tried allowing everything on the page and it still didn't work. Any ideas of what to try next?
    ''Duplicate post, continue [https://support.mozilla.com/en-US/questions/746624 here]''

    Hi there.
    By chance, I too have the readability bookmarklet installed (but I don't use it that much, to be honest), and it works ok for me. It's possible that you are having a problem with some Firefox add-on that is hindering your Firefox's normal behavior. Have you tried disabling all add-ons (just to check), to see if Firefox goes back to normal?
    Whenever you have a problem with Firefox, whatever it is, you should make sure it's not caused by one (or more than one) of your installed add-ons, be it an extension, a theme or a plugin. To do that easily and cleanly, run Firefox in [http://support.mozilla.com/en-US/kb/Safe+Mode safe mode] (don't forget to select ''Disable all add-ons'' when you start safe mode). If the problem disappears, you know it's from an add-on. Disable them all in normal mode, and enable them one at a time until you find the source of the problem. See [http://support.mozilla.com/en-US/kb/Troubleshooting+extensions+and+themes this article] for information about troubleshooting extensions and themes and [https://support.mozilla.com/en-US/kb/Troubleshooting+plugins this one] for plugins.
    If you need support for one of your add-ons, you'll have to contact its author.
    If the problem does not disappear when all add-ons are disabled, please tell me, so we can work from there. Please have no fear of following my instructions to the line, as all can be easily undone.

  • HT5012 How do I get the meddle button to work on my iphone

    How do I get the meddle button to work on my iPhone

    I Cannot use the meddle button on my p
    iPhone

  • How can i get the pressure brush to work in Illustrator CS6?

    how can i get the pressure brush to work in Illustrator CS6?

    yes i do, a bamboo. and pressure works in photoshop

  • How can I get the number pad to work (input characters) on my new plugin Mac full keyboard when connecrted to my mackbook?

    The number pad on by Mac USB keyboard does not work (no input).  I have updated the Mac keyboard drivers and that did fix the problem.  How can I get this keyboard to work when connected to my Powerbook?

    Do you have "Mouse Keys turned on in System Preferences / Universal Access ?
    Mouse Keys     Turn on to use the keyboard instead of the mouse to control your computer

  • How can we get the web cam to work with sykpe or any out going calls

    can get the web cam to work with skype

    Hey there,
    What model laptop is this? Are you using the built-in webcam or is this a external web cam? Also what operating system are you using?
    Thanks!
    Sean
    -------------How do I give Kudos? | How do I mark a post as Solved? --------------------------------------------------------

  • How can I get the main button on my iPhone to work?

    For some reason I haven't been able to back out of any apps or messages or anything to my home screen. The touch screen and the power button works just fine. So basically, I have to turn my phone on and off again to go into anything different. I don't know what to do to make it work again. Please help!!

    The Basic Troubleshooting Steps are:
    Restart... Reset... Restore from Backup...  Restore as New...
    Restart / Reset
    http://support.apple.com/kb/ht1430
    Try this First... You will Not Lose Any Data...
    Turn the Phone Off... ( if it isn’t already )
    Press and Hold the Sleep/Wake Button and the Home Button at the Same Time...
    Wait for the Apple logo to Appear and then Disappear...
    Usually takes about 15 - 20 Seconds... ( But can take Longer...)
    Release the Buttons...
    Turn the Phone On...
    If that does not help... See Here:
    Backing up, Updating and Restoring
    http://support.apple.com/kb/HT1414

  • After my update to version 4, the back button now only seems to store the last page I was on rather than the last 10 like it used to before the update. I've scoured the options menu to no avail. How can I get the back button working like it used to?

    The back button used to work many times before it would reach the end of its list of pages I had been to recently and became greyed out, but now it will only work once before this happens. Also, the list of pages that pops up when I right click it now only has two entries no matter how many pages I've visited on that tab, the page I am currently on and the page I most recently left. Previous to the installation of the update to version 4 however, the list that appeared when I right clicked on the back button contained up to 10 items.

    Try the Firefox SafeMode. <br />
    ''A troubleshooting mode, which disables most other Add-ons.''
    # You can open the Firefox 4.0 SafeMode by holding the '''Shft''' key when you use the Firefox desktop or Start menu shortcut.
    # Or use the Help menu item, click on '''Restart with Add-ons Disabled...''' while Firefox is running. <br />
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before using the Firefox shortcut (without the Shft key) to open it again.''
    If it is good in the Firefox SafeMode, your problem is probably caused by an extension, and you need to figure out which one. <br />
    http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes

Maybe you are looking for

  • Bad wifi performanc​e

    I am having an issue with my wifi. I somehow have horrible wifi reception (sometimes I cannot connect like 3-5 metres away. Are there any possible soultions as I have also discussed this on crackberry and yet to find a solution that works. I've tried

  • WRT120N problem with home-plug "TL PA101"

    I have bought a WRT120N few days ago. I have one PC is connected to the router though home-plug "TL PA101". But I find that the router cannot detect the home-plug in the GUI ->status->DHCP client. And also the "network magic" ->add device or network

  • PSE 9 Scanner Issue- "File already exists"

    Probably a really basic question but PSE is rejecting the first two scans of every multi-scan (usually a 4 photo scan). Says "files already exist" but they don't. They are new images never scanned before. But it will accept the last two images scanne

  • Folder list appearance - change default?

    Is it possible to change or custom design the default folder list appearance on 10.4.5 web server? The scenario is: folders and files are uploaded via ftp to the server by various parties to a shared web realm. The domain has folder listing enabled s

  • Differing Raid 5 volume size on different OS's?

    Hi I have just created a new internal raid 5 set (my first)- and created the volume (fully formated) Am running a dual boot OS system 10.5.8 and 10.6.1 and am getting different capacity readings on the raid set when booted under each OS- should i be