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.

Similar Messages

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

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

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

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

  • Itunes asked me to do an update- I did- it will no longer load. How can I get the itunes program to work?

    Itunes has onced worked on my computer with previous settings. I was asked by Itunes to make a necessary update, which I did. Now Itunes will not work on my computer.

    atoo2 wrote:
    I just did the IOS8 update on my Ipad retina which had 300  photos it asked me to do an iCloud back up which i did but it deleted all my previous photos and now i only have recent photos how do i get back all my old photos? It said befor that my icloud was out of storage but i didnt know it didnt have my old photos, they arnt back up on itunes either is there any way I can get them back?
    Please see the bold.  If you're out of icloud storage, then you won't be able to backup to icloud unless you purchase more storage, but yet you said you backup to icloud.
    If you really did backup to icloud no data would be loss - sounds to me that it didn't backup since you had no more free icloud storage space.
    iCloud: iCloud storage and backup overview

  • How can I get the App store to work?

    I cannot get my App store to work on OS 10.7.4  I don't know how I am going to upgrade with the new system.  I thought the new up grade would help fix the problem, but now I don't know who to get the upgrade because my app store won't load.  I am getting the screen that says
    One Moment Please.
    Connenction to the iTunes Store.
                    Loading...
    If I tunes doesn't open, click the iTunew application icon in you Dock or Windows Task Bar. To download iTunes, Please click here.
    I have tried sign off and back on.  My iTunes works just fine. Only the App store doesn't work.  I have tried the terminal message thing.  I have tried to find my file.  I bought Lion from the app store.  PLEASE help I am so frustrated.  I want to cry.  When I as for help they send me to the boards to the support thing, but nothing on those pages have helped me.  I know there are other post, but  I don't know how to just dump eveything reload and then back up from my time capsule.  How do I do that?  I will that we could just reboot the App store. 
    Thanks

    Incase one is wondering... I found the answers in this entry
    https://discussions.apple.com/message/18810192#18810192
    I tired the
    rm ~/Library/Preferences/com.apple.appstore.plist
    rm ~/Library/Preferences/com.apple.storeagent.plist
    rm -rf ~/Library/Preferences/ByHost/*
    at first because the person was working out of lion but it kept saying not found, but I did everything else here next.  I added the debug thing and didn't work but I didn't.  Then I deauthorized my computer iTunes and reauthorized then signed in and out. Did not work. I then ran the permission  part of Utilities and then ran the repair.  after this I copied all three lines together pasted them into Terminal.  After that it worked.    I am so happy right now.  I think I had to repair the disc to get it right.  I wrote everything I did incase it was a combination of every thing. 
    This is how to enable the debug menu that is part of the thread. 
    Quit the Mac App Store
    Launch the Terminal (located at /Applications/Utilities/)
    Type the following command into the Terminal and then hit return:
    defaults write com.apple.appstore ShowDebugMenu -bool true
    Relaunch the Mac App Store, the Debug menu is next to “Help” in the menubar
    So now to the interesting part: what me helped was to select "clear cookies" in the debug menu first, and second to select "reset Application"
    This was all found in that thread, but it is 11 pages.... this might be more helpful.  There are other suggestions in the tread if this doesn't work for you. 

Maybe you are looking for

  • How to increase the width of a field in oracle reports 6i

    Hello, I'm facing a problem related to width of field. I have a table with field abc varchar2(1500) and when I try to show it in report. I'm unable to see complete data because field size in report is 300. Kindly guide me to increase the size/width o

  • Air print black & white to HP 7525

    Epsom has ap to control Epsom printer so one can chose color, rotate picture, hue, etc.  does HP or apple have app for iPad 4?

  • Half downloaded songs, help?

    I noticed the other day, a couple of the songs I've purchased from iTunes have downloaded, but only about half the song? Is there anyway to sort this out at all because I'm getting nowhere with actually trying to contact iTunes themselves

  • Re : item category in BOm

    Hi     While creating BOM how to set Item category of the higher-level item like TAN TAQ. Thanks mani

  • Change the language of the recovery

    Hello, Is there any way to change the MUI language of the recovery? Both HP and Windows. I bought a DV6-2120EG and recovery is in German. I want to change that to Hungarian. Thank you! Adrian