1 2 Previous Next 43 Replies Latest reply: Jan 13, 2013 10:23 AM by kglad RSS

    Can not get rid of xml loaded image scroller when navigate out of the page.

    nikolaig Community Member

      I have an xml loaded thumb scroller which stays on the screen when I exit the frames where it exists.

      Here is the set up which I have tried to fix this issue. It was suggested that I put an mc on the frames with the image scroller and call it dummy_mc.

      Then I put the code on the frames which are not supposed to have thumb scroller:

      dummy_mc.visible = false;

       

      function removeScrollerF2(e:Event=null):void{

       

      if(scroller){//prevents a problem if you were to use the same navigation code after the scroller is removed

      scroller.removeEventListener(Event.ENTER_FRAME, moveScrollerThumbs);

      removeChild(scroller);

      scroller=null;  // if, when you want to re-create your scroller, it fails to be re-created, remove this line of code.

      }

          trace("dummy2_mc works on null");

      }

       

      dummy_mc.addEventListener(Event.REMOVED_FROM_STAGE,removeScrollerF2);

      ------------------------------------------------------------------------------------------ ---------------------------------

      I have this argument error in the output panel:

      ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.

          at flash.display::DisplayObjectContainer/removeChild()

          at acolyte51c_AppsPopUpsThumbs_fla::mainsite_mc_2/removeScrollerF2()[acolyte51c_AppsPopUpsTh umbs_fla.mainsite_mc_2::frame73:399]

          at flash.display::MovieClip/gotoAndPlay()

          at acolyte51c_AppsPopUpsThumbs_fla::mainsite_mc_2/gotoFrame2()[acolyte51c_AppsPopUpsThumbs_f la.mainsite_mc_2::frame73:372]

       

      This is the frame73:399
      removeChild(scroller);

       


        • 1. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
          Chipleh Community Member

          You need to reference scroller first, i.e.:

           

          function removeScrollerF2(e:Event=null):void

          {

               //I'm guessing your scroller is on the root timeline, else, MovieClip(root) will need to be changed to the instance name of clip where your scroller is located

               var scroller:Object = MovieClip(root).getChildByName("yourScroller'sInstanceName");

               if(scroller){

          hth,

          ~Chipleh

          • 2. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
            kglad CommunityMVP

            use:

             

            dummy_mc.visible = false;

             

            function removeScrollerF2(e:Event=null):void{

             

            if(scroller){//prevents a problem if you were to use the same navigation code after the scroller is removed

            scroller.removeEventListener(Event.ENTER_FRAME, moveScrollerThumbs);

            scroller.parent.removeChild(scroller);

            scroller=null;  // if, when you want to re-create your scroller, it fails to be re-created, remove this line of code.

            }

                trace("dummy2_mc works on null");

            }

             

            dummy_mc.addEventListener(Event.REMOVED_FROM_STAGE,removeScrollerF2);

            • 3. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
              nikolaig Community Member

              I still have the same error:

               

              ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.

                  at flash.display::DisplayObjectContainer/removeChild()

                  at acolyte51c_AppsPopUpsThumbs_fla::mainsite_mc_2/removeScrollerF2()[acolyte51c_AppsPopUpsTh umbs_fla.mainsite_mc_2::frame73:404]

                  at flash.display::MovieClip/gotoAndPlay()

                  at acolyte51c_AppsPopUpsThumbs_fla::mainsite_mc_2/gotoFrame2()[acolyte51c_AppsPopUpsThumbs_f la.mainsite_mc_2::frame73:372]

               

              Line refers to this:
              scroller.parent.removeChild(scroller);

               

              I tried adding .parent one at a time and retest but it did not work either. I added up to five instances (scroller.parent.parent.parent.parent.parent.removeChild(scroller);

              • 4. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
                nikolaig Community Member

                I implemented your code like this:

                var scroller:Object = MovieClip(root).getChildByName("thisOne");

                I get no more errors, but the scroller is still stays on the screen.

                 

                Maybe it helps - here is the code section where I construct the scroller:

                 

                //thumb scroller////////////////////////////////////////////////////////////////////////

                 

                //load xml

                var xmlLoader:URLLoader = new URLLoader();

                /////Parse XML

                var xmlData:XML = new XML();

                var xmlPath:String = "loadingAssets/appThumbnails/slideshow_image_scroller_ActiveTuts_mine/app_thmbs_imgs60x90 .xml";

                xmlLoader.load(new URLRequest(xmlPath));

                xmlLoader.addEventListener(Event.COMPLETE, LoadXML);

                 

                function LoadXML(e:Event):void {

                    xmlData = new XML(e.target.data);

                    buildScroller(xmlData.image); //rather than trace the xmlList, we send it to our buildScroller function

                }

                 

                 

                /////Build Scroller MovieClip to Contain Each Image

                var scroller:MovieClip = new MovieClip();

                var padding:Number = 5;//creating a var for padding to be used later on in easier calculations

                 

                //making the mask+boundaries

                scroller.mask = maskRctngl;

                var maskBorders:Number = 93;// distance from stage borders 88 px + padding 5 px

                 

                 

                this.addChild(scroller);

                 

                scroller.y = 645;

                scroller.x = maskBorders;

                 

                var thumbSmall:Number = 1;//setting up scale Tween on rollover

                var thumbLarge:Number = 1.05;//setting up scale Tween on rollover

                /////

                 

                /////Parse XML

                //build scroller from xml

                function buildScroller(imageList:XMLList):void{

                   

                    for (var item:uint = 0; item<imageList.length();item++) {

                        var thisOne:MovieClip = new MovieClip();

                       

                       

                        //outline

                        var thumbFadeOut:Number = .3;//setting Border Tweens//doesn't work with TweenMax transitions

                        var thumbFadeIn:Number = .7;//setting Border Tweens//doesn't work with TweenMax transitions

                       

                        var blackBox:Sprite = new Sprite();

                        blackBox.graphics.beginFill(0xFFFFFF);

                        blackBox.graphics.drawRect(-1, -1, 62, 92);

                        blackBox.alpha = thumbFadeOut;//setting Border Tweens

                        thisOne.addChild(blackBox);

                        thisOne.blackBox = blackBox;//setting Border Tweens

                       

                       

                        thisOne.x = thisOne.myx = (60 + padding) *item;

                        thisOne.itemNum = item;

                        thisOne.title = imageList[item].attribute("title");

                        thisOne.link = imageList[item].attribute("url");

                        thisOne.src = imageList[item].attribute("src");

                        thisOne.alpha = 0;//makes all thumb images at alpha=0 before they are fully loaded

                 

                       

                        //Loading and Adding the Images

                        //image container

                        var thisThumb:MovieClip = new MovieClip();

                        //add image

                        var ldr:Loader = new Loader();

                        var urlReq:URLRequest = new URLRequest(thisOne.src);

                        ldr.load(urlReq);

                        //assign event listeners for Loader

                        ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,completeHandler_AppPopUps);//tells us when the loading is complete

                        ldr.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorHandler_AppPopUps);//tells us if there are any typo errors when the loading is complete

                        thisThumb.addChild(ldr);

                        thisOne.addChild(thisThumb);

                       

                        //create listeners for this thumb

                        thisOne.buttonMode = true;//makes boxes act as buttons

                        thisOne.addEventListener(MouseEvent.CLICK, clickScrollerItem_AppPopUps);//makes boxes act as buttons

                        thisOne.addEventListener(MouseEvent.MOUSE_OVER, overScrollerItem_AppPopUps);//traces the title when the mouse is over the bounding box in the Output Panel

                        thisOne.addEventListener(MouseEvent.MOUSE_OUT, outScrollerItem_AppPopUps);//traces the title when the mouse is out the bounding box in the Output Panel

                 

                       

                        //add item

                        scroller.addChild(thisOne);

                    }

                    scroller.addEventListener(Event.ENTER_FRAME, moveScrollerThumbs);//adding movement on mouse position

                   

                }

                • 5. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
                  Chipleh Community Member

                  //This will add the scroller to the root timeline

                  addChild(scroller);

                  //This will give the scroller an instance name of 'theScroller'

                  scroller.name = "theScroller"

                   

                  //This will remove the instance of scroller

                  var scroller:Object = MovieClip(root).getChildByName('theScroller");

                  if(scroller)

                  {

                       removeChild(scroller)

                  }

                  • 6. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
                    nikolaig Community Member

                    I get errors, Probably I did not apply the code as you intended. Here is the hole line of code:

                     

                    dummy_mc.visible = false;

                    dummy_mc.addEventListener(Event.REMOVED_FROM_STAGE,removeScrollerF2);

                     

                    function removeScrollerF2(e:Event=null):void{

                     

                    //This will add the scroller to the root timeline

                    addChild(scroller);

                     

                    //This will give the scroller an instance name of 'theScroller'

                    scroller.name = "theScroller"

                     

                    //This will remove the instance of scroller

                    var scroller:Object = MovieClip(root).getChildByName("theScroller");

                     

                    if(scroller){//prevents a problem if you were to use the same navigation code after the scroller is removed

                     

                    scroller.removeEventListener(Event.ENTER_FRAME, moveScrollerThumbs);

                     

                    removeChild(scroller);

                     

                    scroller=null;  // if, when you want to re-create your scroller, it fails to be re-created, remove this line of code.

                     

                    }

                        trace("dummy2_mc works on null");

                    }

                     

                    ------------------------------------------------------------------------------------------ --------


                    here is the errror message I get:

                     

                    Symbol 'mainsite_mc', Layer 'AS3', Frame 73, Line 4101118: Implicit coercion of a value with static type Object to a possibly unrelated type flash.display:DisplayObject.

                     

                    Line 410 refers to this: removeChild(scroller);

                    ---------------------------------------------------------------------------------------------------

                     

                    Please let me know if the lines: 

                    //This will add the scroller to the root timeline

                    addChild(scroller);

                    //This will give the scroller an instance name of 'theScroller'

                    scroller.name = "theScroller"

                    are supposed to be in another location in the code"

                     

                    ------------------------------------------------------------------------------------------ ----------

                     

                    In the code section which constructs the scrolle (I have posted before) i noticed these lines (perhaps it shows the way the scroller is constructed):

                     

                    /////Build Scroller MovieClip to Contain Each Image

                    var scroller:MovieClip = new MovieClip();

                     

                    this.addChild(scroller);

                    • 7. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
                      kglad CommunityMVP

                      then scroller is not added to the stage.  use:

                       

                      if(scroller){//prevents a problem if you were to use the same navigation code after the scroller is removed

                      if(scroller.stage){

                      scroller.removeEventListener(Event.ENTER_FRAME, moveScrollerThumbs);

                      scroller.parent.removeChild(scroller);

                      scroller=null;  // if, when you want to re-create your scroller, it fails to be re-created, remove this line of code.

                      }

                      }

                      • 8. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
                        nikolaig Community Member

                        does not work.

                        My entire code is this:

                         

                        dummy_mc.visible = false;

                        dummy_mc.addEventListener(Event.REMOVED_FROM_STAGE,removeScrollerF2);

                         

                        function removeScrollerF2(e:Event=null):void{

                         

                        //This will give the scroller an instance name of 'theScroller'

                        //scroller.name = "theScroller"

                         

                        //This will remove the instance of scroller

                        var scroller:Object = MovieClip(root).getChildByName("theScroller");

                         

                        if(scroller){//prevents a problem if you were to use the same navigation code after the scroller is removed

                         

                        scroller.removeEventListener(Event.ENTER_FRAME, moveScrollerThumbs);

                         

                        scroller.parent.removeChild(scroller);

                         

                        scroller=null;  // if, when you want to re-create your scroller, it fails to be re-created, remove this line of code.

                         

                        }

                        }

                         

                        I got rid of the line addChild(scroller);

                         

                        With the line //scroller.name = "theScroller" I get no errors but the scroller is still on the pages when I navigate out.

                        If I uncomment the line scroller.name = "theScroller" then I get this error message:

                        TypeError: Error #1009: Cannot access a property or method of a null object reference.

                            at acolyte51c_AppsPopUpsThumbs_fla::mainsite_mc_2/removeScrollerF2()[acolyte51c_AppsPopUpsTh umbs_fla.mainsite_mc_2::frame73:401]

                            at flash.display::MovieClip/gotoAndPlay()

                            at acolyte51c_AppsPopUpsThumbs_fla::mainsite_mc_2/gotoFrame2()[acolyte51c_AppsPopUpsThumbs_f la.mainsite_mc_2::frame73:372]

                         


                        frame73:401 is this: scroller.name = "theScroller"

                        • 9. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
                          kglad CommunityMVP

                          you didn't use the code i suggested.  again, use:

                           

                           

                          if(scroller){//prevents a problem if you were to use the same navigation code after the scroller is removed

                          if(scroller.stage){

                          scroller.removeEventListener(Event.ENTER_FRAME, moveScrollerThumbs);

                          scroller.parent.removeChild(scroller);

                          scroller=null;  // if, when you want to re-create your scroller, it fails to be re-created, remove this line of code.

                          }

                          }

                          • 10. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
                            nikolaig Community Member

                            Here is the entire code (which is located on the same frames as the xml image thumb scroller):

                             

                            dummy_mc.visible = false;

                            dummy_mc.addEventListener(Event.REMOVED_FROM_STAGE,removeScrollerF2);

                             

                            function removeScrollerF2(e:Event=null):void{

                             

                            if(scroller){//prevents a problem if you were to use the same navigation code after the scroller is removed

                            if(scroller.stage){

                            scroller.removeEventListener(Event.ENTER_FRAME, moveScrollerThumbs);

                            scroller.parent.removeChild(scroller);

                            scroller=null;  // if, when you want to re-create your scroller, it fails to be re-created, remove this line of code.

                            }

                            }

                            }

                            ------------------------------------------------------------------------------------------ ---------

                             

                            I got rid off:

                            //This will add the scroller to the root timeline

                            addChild(scroller);

                             

                            //This will give the scroller an instance name of 'theScroller'

                            scroller.name = "theScroller"

                             

                            //This will remove the instance of scroller

                            var scroller:Object = MovieClip(root).getChildByName("theScroller");

                            ------------------------------------------------------------------------------------------ ---------

                            I still get the same error:

                             

                            ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.

                                at flash.display::DisplayObjectContainer/removeChild()

                                at acolyte51c_AppsPopUpsThumbs_fla::mainsite_mc_2/removeScrollerF2()[acolyte51c_AppsPopUpsTh umbs_fla.mainsite_mc_2::frame73:400]

                                at flash.display::MovieClip/gotoAndPlay()

                                at acolyte51c_AppsPopUpsThumbs_fla::mainsite_mc_2/gotoFrame2()[acolyte51c_AppsPopUpsThumbs_f la.mainsite_mc_2::frame73:372]

                             


                            frame73:400 is this line: scroller.parent.removeChild(scroller);

                            • 11. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
                              kglad CommunityMVP

                              is all your code attached to the same timeline including your pageB code?

                              • 12. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
                                nikolaig Community Member

                                yes, all my code in on the same main timeline in the pageB section.

                                • 13. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
                                  kglad CommunityMVP

                                  what do you mean by pageB section?

                                  • 14. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
                                    nikolaig Community Member

                                    I segmented my time line into labeled sections separated by key frames. Each section is at about 10 frames so I can read what the label says and know where I am on the time line. The labeled section with the xml constructed image thumb scroller is located on frames 73 to 82. I refered to this section as pageB in my previous post about troubled "holderMovieClip" for SWF Loader you have helped me a day before.

                                     

                                    All the code for the constructing an xml loaded image thumb scroller and the code we are working on right now is located on the main time line on the pageB section, i.e. on the section from frames 73 to 82. There are now individual key frames between 73-82.

                                     

                                    (each section is assigned unique names. For example the labeled section I refer to as "pageB" is actually named "appPopUps". All those label names make sense to me, but I figured "pageB" would be easier to use to resolve this code issue)

                                    • 15. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
                                      kglad CommunityMVP

                                      actually, in this and all future posts in this and other flash threads, it will much less confusing to simply refer to frame numbers or you must make it clear you're using frame labels.  using pageB sounds like a movieclip name.

                                       

                                      what does the following trace reveal:

                                       

                                      dummy_mc.visible = false;

                                      dummy_mc.addEventListener(Event.REMOVED_FROM_STAGE,removeScrollerF2);

                                       

                                      function removeScrollerF2(e:Event=null):void{

                                       

                                      if(scroller){//prevents a problem if you were to use the same navigation code after the scroller is removed

                                      if(scroller.stage){

                                      trace(scroller.parent.name, scroller.name);

                                      trace(scroller.parent.getChildByName(scroller.name).name);

                                      scroller.removeEventListener(Event.ENTER_FRAME, moveScrollerThumbs);

                                      scroller.parent.removeChild(scroller);

                                      scroller=null;  // if, when you want to re-create your scroller, it fails to be re-created, remove this line of code.

                                      }

                                      }

                                      }

                                      • 16. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
                                        nikolaig Community Member

                                        when I navigate out of frames 73-82 (where the xml scroller and trace code is located) then on the labeled section I havigate to I have the following:

                                        instance2 instance579

                                        TypeError: Error #1009: Cannot access a property or method of a null object reference.

                                            at acolyte51c_AppsPopUpsThumbs_fla::mainsite_mc_2/removeScrollerF2()[acolyte51c_AppsPopUpsTh umbs_fla.mainsite_mc_2::frame73:423]

                                            at flash.display::MovieClip/gotoAndPlay()

                                            at acolyte51c_AppsPopUpsThumbs_fla::mainsite_mc_2/onClick_ContactUs_btn()[acolyte51c_AppsPop UpsThumbs_fla.mainsite_mc_2::frame1:1044]

                                         

                                        line 73:423 refers to:

                                        trace(scroller.parent.getChildByName(scroller.name).name);

                                        • 17. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
                                          kglad CommunityMVP

                                          what does the following trace reveal:

                                           

                                          dummy_mc.visible = false;

                                          dummy_mc.addEventListener(Event.REMOVED_FROM_STAGE,removeScrollerF2);

                                           

                                          function removeScrollerF2(e:Event=null):void{

                                           

                                          if(scroller){//prevents a problem if you were to use the same navigation code after the scroller is removed

                                          if(scroller.stage){

                                          trace(scroller.parent.name, scroller.name);

                                          for(var i:int=0;i<scroller.parent.numChildren;i++){

                                          trace(scroller.parent.getChildAt(i).name);

                                          }

                                          scroller.removeEventListener(Event.ENTER_FRAME, moveScrollerThumbs);

                                          scroller.parent.removeChild(scroller);

                                          scroller=null;  // if, when you want to re-create your scroller, it fails to be re-created, remove this line of code.

                                          }

                                          }

                                          }

                                          • 18. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
                                            nikolaig Community Member

                                            instance2 instance579

                                            instance3

                                            TypeError: Error #1009: Cannot access a property or method of a null object reference.

                                                at acolyte51c_AppsPopUpsThumbs_fla::mainsite_mc_2/removeScrollerF2()[acolyte51c_AppsPopUpsTh umbs_fla.mainsite_mc_2::frame73:425]

                                                at flash.display::MovieClip/gotoAndPlay()

                                                at acolyte51c_AppsPopUpsThumbs_fla::mainsite_mc_2/gotoFrame2()[acolyte51c_AppsPopUpsThumbs_f la.mainsite_mc_2::frame73:372]

                                             

                                             

                                             

                                            frame73:425 refers to:

                                            trace(scroller.parent.getChildAt(i).name);

                                            • 19. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
                                              kglad CommunityMVP

                                              what does the following trace reveal:

                                               

                                              dummy_mc.visible = false;

                                              dummy_mc.addEventListener(Event.REMOVED_FROM_STAGE,removeScrollerF2);

                                               

                                              function removeScrollerF2(e:Event=null):void{

                                               

                                              if(scroller){//prevents a problem if you were to use the same navigation code after the scroller is removed

                                              if(scroller.stage){

                                              trace(scroller.parent.name, scroller.name);

                                              for(var i:int=0;i<scroller.parent.numChildren;i++){

                                              trace(i, scroller.parent.getChildAt(i));

                                              }

                                              scroller.removeEventListener(Event.ENTER_FRAME, moveScrollerThumbs);

                                              scroller.parent.removeChild(scroller);

                                              scroller=null;  // if, when you want to re-create your scroller, it fails to be re-created, remove this line of code.

                                              }

                                              }

                                              }

                                              • 20. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
                                                nikolaig Community Member

                                                instance2 instance579

                                                0 [object Shape]

                                                1 null

                                                2 null

                                                3 null

                                                4 null

                                                5 null

                                                6 null

                                                7 null

                                                8 null

                                                9 [object MovieClip]

                                                10 [object Shape]

                                                11 [object MovieClip]

                                                12 [object MovieClip]

                                                13 [object MovieClip]

                                                ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.

                                                    at flash.display::DisplayObjectContainer/removeChild()

                                                    at acolyte51c_AppsPopUpsThumbs_fla::mainsite_mc_2/removeScrollerF2()[acolyte51c_AppsPopUpsTh umbs_fla.mainsite_mc_2::frame73:431]

                                                    at flash.display::MovieClip/gotoAndPlay()

                                                    at acolyte51c_AppsPopUpsThumbs_fla::mainsite_mc_2/onClick_ContactUs_btn()[acolyte51c_AppsPop UpsThumbs_fla.mainsite_mc_2::frame1:1044]

                                                 

                                                line 431 refers to :

                                                scroller.parent.removeChild(scroller);

                                                 

                                                 

                                                ---------------------

                                                 

                                                I have to step out for a few hours, thank you. I will test the site again after I come back.

                                                Best Regards

                                                • 21. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
                                                  kglad CommunityMVP

                                                  that is quite a mess you have there.  i don't think i've ever seen anything like that.

                                                   

                                                  upload your fla to a server and post a link.

                                                  • 22. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
                                                    nikolaig Community Member

                                                    Thanks for taking a look at my file. My flash site uses a lot of loaded swf files which are used in navigation as well. So I ended up compiling a folder with all depended files. It came down to be a  615MB file if I include all videos which are used on the site.

                                                    This file is called "stage three A.zip". Videos are not used for navigation, so perhaps it will be easier to download a version without them.

                                                    Then I made a smaller file without all the videos "stage three B.zip" which is at 118MB.

                                                     

                                                    You can access it in two ways.

                                                    1. Go to http://ngrinchenko.com/flashFiles/

                                                    Name:   flashHelp

                                                    Password:   flashHelp2013

                                                     

                                                    Please choose iether a complete version or a smaller version without the videos : "stage three B.zip"

                                                     

                                                    2. Using an FTP application

                                                    Hostname:   ngrinchenko.com

                                                    Username:   kglad

                                                    Password:    flashHelp2013

                                                    (if you will be promted for a folder use flashFiles, but it should not be requested)

                                                     

                                                    Thank you for your help. I greatly welcome your critique. However I understand that most probably I have a lot of mistakes there and it will be impossible to address most of them. But I would appreciate if you could point out anything you can to make the site better. Perhaps I have some major messes which would be possible to address?

                                                     

                                                    You will notice that the site is 90% animated with greensock tween engine. I am in the process of removing the last flash based tweens.

                                                     

                                                    Once you download the file please click on "newTest.fla"

                                                     

                                                    Once you download the file please let me know I would like to take it off the server.

                                                     

                                                    Thank you.

                                                    • 23. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
                                                      kglad CommunityMVP

                                                      you can take it off the server.

                                                       

                                                      what needs to be done to trigger the error?

                                                      • 24. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
                                                        nikolaig Community Member

                                                        Forgot about it.

                                                        When the site opens and you see how the collage of images animates on the screen into place, please click on any of them. It will bring you to the screen whith the clicked image bigger version and an image thumb scroller at the bottom of the screen. If you click on any of the smaller thumb nails then you are still in the same labeled section and no error happens. If you click on any of the main navigation buttons on top or any of the small products pictures (which light up on roll over) on the right of the large image then you navigate out of this labeled section. This is when the error happens, when a user leaves the labeled section with the xml loaded image thumb scroller. The scroller still stays on the screeen and all the errrors happen.

                                                        • 25. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
                                                          kglad CommunityMVP

                                                          on mainsite_mc frame 73:

                                                           

                                                          replace line 38:

                                                           

                                                          this.addChild(scroller);

                                                           

                                                          with

                                                           

                                                          dummy_mc.addChild(scroller);

                                                           

                                                          and replace the code from 407+ with:

                                                           

                                                          //dummy_mc.visible = false;  <- remove the graphics from the stage of dummy_mc

                                                          dummy_mc.addEventListener(Event.REMOVED_FROM_STAGE,removeScrollerF2);

                                                           

                                                          function removeScrollerF2(e:Event=null):void{

                                                          scroller.removeEventListener(Event.ENTER_FRAME, moveScrollerThumbs);

                                                          }

                                                          • 26. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
                                                            nikolaig Community Member

                                                            There is no scroller on the bottom of the screen in the labeled section "appPopUps", in the frames 73-82 when I test the site.

                                                            Otherwice I get no errors and can navigate out of the page.

                                                            Does the scroller appear on your screen?

                                                            • 27. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
                                                              kglad CommunityMVP

                                                              yes.  did you comment out the dummy_mc.visible = false line?

                                                              • 28. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
                                                                nikolaig Community Member

                                                                Yes, I removed the graphics as well. dummy_mc is now just a dot 1px X 1px on the top right corner.

                                                                The only code for removing the scroller is this:

                                                                dummy_mc.addEventListener(Event.REMOVED_FROM_STAGE,removeScrollerF2);

                                                                 

                                                                 

                                                                 

                                                                function removeScrollerF2(e:Event=null):void{

                                                                 

                                                                scroller.removeEventListener(Event.ENTER_FRAME, moveScrollerThumbs);

                                                                 

                                                                }

                                                                 

                                                                I commented out previous code:

                                                                /*dummy_mc.visible = false;

                                                                 

                                                                dummy_mc.addEventListener(Event.REMOVED_FROM_STAGE,removeScrollerF2);

                                                                 

                                                                 

                                                                 

                                                                function removeScrollerF2(e:Event=null):void{

                                                                 

                                                                 

                                                                 

                                                                if(scroller){//prevents a problem if you were to use the same navigation code after the scroller is removed

                                                                 

                                                                if(scroller.stage){

                                                                 

                                                                trace(scroller.parent.name, scroller.name);

                                                                 

                                                                for(var i:int=0;i<scroller.parent.numChildren;i++){

                                                                 

                                                                trace(i, scroller.parent.getChildAt(i));

                                                                 

                                                                }

                                                                 

                                                                scroller.removeEventListener(Event.ENTER_FRAME, moveScrollerThumbs);

                                                                 

                                                                scroller.parent.removeChild(scroller);

                                                                 

                                                                scroller=null;  // if, when you want to re-create your scroller, it fails to be re-created, remove this line of code.

                                                                 

                                                                }

                                                                 

                                                                }

                                                                 

                                                                }*/

                                                                 

                                                                Should some parts of it be implemented in what you specified?


                                                                • 30. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
                                                                  nikolaig Community Member

                                                                  Wow, mind melting for me - this is works!!!

                                                                   

                                                                  So if dummy_mc is not at 0,0 coordinates and has no graphics in it - this set up will not work?

                                                                   

                                                                  Thanks a lot for your help!!!

                                                                   

                                                                  P.S. Since you have looked at my file, is it possible to mention what were my major errors?

                                                                  • 31. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
                                                                    kglad CommunityMVP

                                                                    dummy_mc can have graphics but you don't want to see them and if you assign its visible property to false then its children will also be invisible.  because i had you add scroller to dummy_mc, you want the children to be visible.

                                                                     

                                                                    dummy_mc can be at a location other than 0,0.  but again, because scroller is a child it will be shifted in position (unless you offset it).

                                                                     

                                                                    and, i couldn't find the cause of the problem.  there are quite a few problems with your setup that makes debugging time-consuming so i looked for a work-around rather than actually fixing the problem.

                                                                     

                                                                    i didn't think it was possible that this could lead to ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller:

                                                                     

                                                                    scroller.parent.removeChild(scroller);

                                                                     

                                                                    and i still understand how that could happen.

                                                                    • 32. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
                                                                      nikolaig Community Member

                                                                      thank you for your time and explanation.

                                                                      Is it possible to outline what are the problems with my set up so I can avoid them in the future?

                                                                      • 33. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
                                                                        kglad CommunityMVP

                                                                        you're welcome.

                                                                         

                                                                        in a nutshell, there should be minimal code on timelines or, at most, code in one frame/one timeline.

                                                                        • 34. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
                                                                          nikolaig Community Member

                                                                          Meaning that the code should be referenced as an external class?

                                                                          Or all of the code should be on the first frame of my time line?

                                                                           

                                                                          Presently all my code on one main timeline but sectioned out for each labeled section. I.e. whatever actions happen in the frames 1-10 I would put the code which makes it happen, whatever actions happen in frames 11-20 I would put code to make it happen. Is it acceptable?

                                                                          • 35. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
                                                                            kglad CommunityMVP

                                                                            using class files would be best.

                                                                             

                                                                            but if you use timeline code (beyond stop,play and goto) it should be limited to one frame.

                                                                            • 38. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
                                                                              nikolaig Community Member

                                                                              I found a new bug with the scroller, which I can not figure out how to fix it or why it happens. Scroller does not work completely if I were to access it from a different labeled section.

                                                                              If you still have my files, please go to products and click on of the images - larger pop up window will appear on the screen, click on one of the images at the bottom of the pop up window. It will bring you to the labeled section with the scroller. If scroller accessed this way then somehow the middle of the screen becomes unclickable for the scroller items, i.e. I can click only at the two most left and right images. As well as only extreme most right hand row of the buttons on the bigger image pop is working. It is as if swath is in the middle of the screen which doesn't allow for clicks. I think it might correspond to the "function moveScrollerThumb" set limitations of left and right areas where scroller starts to speed up, but it is a guess.

                                                                               

                                                                              Just a reminder. The way the scroller works in a normal way is if you go to applications page and then click on one of the images.

                                                                              • 39. Re: Can not get rid of xml loaded image scroller when navigate out of the page.
                                                                                kglad CommunityMVP

                                                                                i think you may run into numerous problems just because your setup is problematic.

                                                                                1 2 Previous Next