6 Replies Latest reply on Jun 29, 2016 7:08 AM by sawmangs4

    Nested MovieClips Keep looping even with stop() in their timeline

    sawmangs4

      In the image below you can see 7 movieclips that look like tabs (Patients, Address, Eligibility, Authorization, PRE, Propensity To Pay, and Work Queues) and they are nested inside another movieclip (tabedPages_mc). Each tab has the identical actionscript on it's timeline which you can also see in the image below. They each have 3 frames which represent different states like buttons. However, I have not yet coded anything for the 3rd frame yet.

       

      When this movie is tested the Patients tab and the Work Queues tab function properly. In other words, they do not loop and are stopped on the first frame. If I hover the mouse over them they will gotoAndStop(2) just as the code says. When the mouse is moved away, they go back to frame 1 as expected.

       

      However, the other 5 tabs do not respond to the code and just continue to loop.

       

      Any ideas?

       

      loopingButtons.png

      Thanks

        • 1. Re: Nested MovieClips Keep looping even with stop() in their timeline
          robdillon Most Valuable Participant

          Do you get any errors? Is each mouse over and mouse out events private to each of the movieclips?

          • 2. Re: Nested MovieClips Keep looping even with stop() in their timeline
            sawmangs4 Level 1

            Getting no errors and yes, each movie clip has that code on it's own timeline.

            • 3. Re: Nested MovieClips Keep looping even with stop() in their timeline
              Ned Murphy Adobe Community Professional & MVP

              Usually when movieclips don't obey stop() commands there is a coding issue - not necessarily the code they contain, it could be anywhere.

               

              Do you get the traces that you already show constantly filling up the output panel?

               

              Put traces inside the event handlers to see if you are getting mouse interaction from the failing movieclips.

              • 4. Re: Nested MovieClips Keep looping even with stop() in their timeline
                sawmangs4 Level 1

                The trace statement you see does not trace. That trace statement is in the Address tab and it is one that loops. I have a similar trace in the Patients tab which does not loop and functions properly. However, that trace statement in Patients only outputs when the tab is hovered over.

                • 5. Re: Nested MovieClips Keep looping even with stop() in their timeline
                  Ned Murphy Adobe Community Professional & MVP

                  If it is failing to stop and failing to trace it would appear that somewhere your file is experiencing a coding error.  In the Publish Settings make sure your Actionscript settings are set for strict and also select the option to Permit Debugging.  This may help find if there is a coding error.

                  1 person found this helpful
                  • 6. Re: Nested MovieClips Keep looping even with stop() in their timeline
                    sawmangs4 Level 1

                    I always code with strict selected and Permit Debugging yet I'm not getting any error output on this. The tabs are nested inside a movieclip called tabedPages_mc which is nested inside another movieclip called PAhomePage_mc. tabedPages_mc has a class file called PatientTabs. PatientTabs is declared inside PAhomePage_mc which has a class called PAhomePage. So the structure is like this:

                     

                    - MovieClip - PAhomePage_mc > class - PAhomePage

                    - MovieClip - tabedPages_mc > class - PatientTabs

                    - Then the 7 tabs

                     

                    PAhomePage class code:

                     

                    package
                    {
                    import flash.display.*;
                    import flash.events.*;

                    public class PAhomePage extends MovieClip
                    {
                      public var homeScreen:Screen = Screen.mainScreen; // This represents the primary display not calculating task bar/Dock.
                                    // Display Objects within the bounds of the mainScreen can be
                                    // hidden under task bar/Dock. Use "visibleBounds" to place
                                    // display objects without being hidden under task bar/dock.
                      public var HPbrowser;
                      public var headtype:String = "FullHeader";
                      public var PAhomePageBack;
                      public var arrowLeft;
                      public var arrowRight;
                      public var topGrey;
                      public var prodChart;
                      public var collapsePanel;
                      public var tabline;
                      public var PAtabs;
                      public var hpfooter;
                      public var title:String = "https://assistant-cert.emdeon.com/";

                      public function PAhomePage()
                      {
                       trace("PAhomePage called!");
                       if(stage)
                       {
                        initPAhomePage();
                       }
                       else
                       {
                        addEventListener(Event.ADDED_TO_STAGE, initPAhomePage);
                       }
                      } // ----------------------------------------------------------------------------------------- ----- End public constructor function initPAhomePage().
                     
                      public function initPAhomePage(e:Event = null):void
                      {
                       trace("homeScreen is: "+PAhomePageBack);
                      
                       HPbrowser = MovieClip(parent.parent.parent.parent);
                       //--- PAhomePageBack
                       PAhomePageBack.width = PADemo.resizeAsset(1024,homeScreen.visibleBounds.width,1024)-16;
                       PAhomePageBack.scaleY = PAhomePageBack.scaleX;
                       // --- Header assets
                      
                       // --- Top Grey Section Backing
                       topGrey.width = PADemo.resizeAsset(1024,homeScreen.visibleBounds.width,1024)-16;
                       topGrey.scaleY = topGrey.scaleX;
                      
                       // --- arrowLeft
                       arrowLeft.width = PADemo.resizeAsset(1024,homeScreen.visibleBounds.width,11);
                       arrowLeft.scaleY = arrowLeft.scaleX;
                       arrowLeft.x = 40; // When only referencing width it refers to width of this class instance.
                       arrowLeft.buttonMode = true;
                       arrowLeft.useHandCursor = true;
                       arrowLeft.mouseChildren = false;
                       // --- arrowRight
                       arrowRight.width = PADemo.resizeAsset(1024,homeScreen.visibleBounds.width,11);
                       arrowRight.scaleY = arrowRight.scaleX;
                       arrowRight.x = width - 40; // When only referencing width it refers to width of this class instance.
                       arrowRight.buttonMode = true;
                       arrowRight.useHandCursor = true;
                       arrowRight.mouseChildren = false;
                       // --- Productivity Chart
                       prodChart.width = PADemo.resizeAsset(1024,homeScreen.visibleBounds.width,375.55);
                       prodChart.scaleY = prodChart.scaleX;
                       prodChart.x = 75; // When only referencing width it refers to width of this class.
                       // --- Collapse Panel
                       collapsePanel.width = PADemo.resizeAsset(1024,homeScreen.visibleBounds.width,1002.95);
                       collapsePanel.scaleY = collapsePanel.scaleX;
                       collapsePanel.x = 20; // When only referencing width it refers to width of this class.
                       collapsePanel.y = prodChart.x + prodChart.height -10;
                       // --- Tab Pages
                       PAtabs.width = PADemo.resizeAsset(1024,homeScreen.visibleBounds.width,1024)-16;
                       PAtabs.scaleY = PAtabs.scaleX;
                       PAtabs.x = width/2 - PAtabs.width/2; // When only referencing width it refers to this class.
                       PAtabs.y = topGrey.y + topGrey.height;
                      
                       //--- HPfooter
                       hpfooter.width = PADemo.resizeAsset(1024,homeScreen.visibleBounds.width,1024)-16;
                       hpfooter.scaleY = hpfooter.scaleX;
                       hpfooter.y = height - hpfooter.height;
                      }
                    } // ========================================================================== End public class PAhomePage{}.
                    } // ======================================================================================== End package{}.

                     

                    PatientTabs class code:

                     

                    package
                    {
                    import flash.display.*;
                    import flash.events.*;

                    public class PatientTabs extends MovieClip
                    {
                      //public var PTsBrowser;
                      public var pat_tab;
                      public var address_tab;
                      public var eligibility_tab;
                      public var authorization_tab;
                      public var pre_tab;
                      public var propensitytopay_tab;
                      public var workqueues_tab;
                      public var filterdd;
                     
                      //private var tabs:Array = [pat_tab,address_tab,eligibility_tab,authorization_tab,pre_tab,propensitytopay_tab,workqu eues_tab];

                      public function PatientTabs()
                      {
                       if(stage)
                       {
                        initPatientTabs();
                       }
                       else
                       {
                        addEventListener(Event.ADDED_TO_STAGE, initPatientTabs);
                       }
                      } // ----------------------------------------------------------------------------------------- ------ End public constructor function PatientTabs().
                     
                      public function initPatientTabs(e:Event = null):void
                      {
                       trace("PatientTabs called!");
                       //PTsBrowser = MovieClip(parent.parent.parent.parent.parent);
                      
                       //address_tab.gotoAndStop(1);
                       pat_tab.addEventListener(MouseEvent.CLICK, clickedATab);
                       address_tab.addEventListener(MouseEvent.CLICK, clickedATab);
                       eligibility_tab.addEventListener(MouseEvent.CLICK, clickedATab);
                       authorization_tab.addEventListener(MouseEvent.CLICK, clickedATab);
                       pre_tab.addEventListener(MouseEvent.CLICK, clickedATab);
                       propensitytopay_tab.addEventListener(MouseEvent.CLICK, clickedATab);
                       workqueues_tab.addEventListener(MouseEvent.CLICK, clickedATab);
                      } // ----------------------------------------------------------------------------------------- -------------- End public function initPatientTabs().
                     
                      private function clickedATab(e:MouseEvent = null):void
                      {
                       switch(e.target)
                       {
                        case pat_tab :
                         gotoAndStop(1);
                         //pat_tab.removeEventListener(MouseEvent.MOUSE_OUT, pat_tab.outTab);
                         //pat_tab.removeEventListener(MouseEvent.MOUSE_OVER, pat_tab.overTab);
                         //restoreFunctions(pat_tab);
                         //pat_tab.gotoAndStop(3);
                        break;
                        case address_tab :
                         gotoAndStop(2);
                         //address_tab.removeEventListener(MouseEvent.MOUSE_OUT, address_tab.outTab);
                         //address_tab.removeEventListener(MouseEvent.MOUSE_OVER, address_tab.overTab);
                         //restoreFunctions(address_tab);
                         //address_tab.gotoAndStop(3);
                        break;
                        case eligibility_tab :
                         gotoAndStop(3);
                         //eligibility_tab.removeEventListener(MouseEvent.MOUSE_OUT, eligibility_tab.outTab);
                         //eligibility_tab.removeEventListener(MouseEvent.MOUSE_OVER, eligibility_tab.overTab);
                         //restoreFunctions(eligibility_tab);
                         //eligibility_tab.gotoAndStop(3);
                        break;
                        case authorization_tab :
                         gotoAndStop(4);
                         //authorization_tab.removeEventListener(MouseEvent.MOUSE_OUT, authorization_tab.outTab);
                         //authorization_tab.removeEventListener(MouseEvent.MOUSE_OVER, authorization_tab.overTab);
                         //restoreFunctions(authorization_tab);
                         //authorization_tab.gotoAndStop(3);
                        break;
                        case pre_tab :
                         gotoAndStop(5);
                         //pre_tab.removeEventListener(MouseEvent.MOUSE_OUT, pre_tab.outTab);
                         //pre_tab.removeEventListener(MouseEvent.MOUSE_OVER, pre_tab.overTab);
                         //restoreFunctions(pre_tab);
                         //pre_tab.gotoAndStop(3);
                        break;
                        case propensitytopay_tab :
                         gotoAndStop(6);
                         //propensitytopay_tab.removeEventListener(MouseEvent.MOUSE_OUT, propensitytopay_tab.outTab);
                         //propensitytopay_tab.removeEventListener(MouseEvent.MOUSE_OVER, propensitytopay_tab.overTab);
                         //restoreFunctions(propensitytopay_tab);
                         //propensitytopay_tab.gotoAndStop(3);
                        break;
                        case workqueues_tab :
                         gotoAndStop(7);
                         //workqueues_tab.removeEventListener(MouseEvent.MOUSE_OUT, workqueues_tab.outTab);
                         //workqueues_tab.removeEventListener(MouseEvent.MOUSE_OVER, workqueues_tab.overTab);
                         //restoreFunctions(workqueues_tab);
                         //workqueues_tab.gotoAndStop(3);
                        break;
                       }
                      } // ----------------------------------------------------------------------------------------- ----------------- End private function clickedATab().
                     
                      private function restoreFunctions(tab:MovieClip)
                      {
                       trace(tab);
                       /*for(var i = 0; i < tabs.length; i++)
                       {
                        trace("tabs[i] is: "+tabs[i]);
                        trace(tab);
                        if(tabs[i].currentFrame == 3 && tabs[i] != tab)
                        {
                         trace("tabs[i] is: "+tabs[i]);
                        }
                       }*/
                      
                      } // ----------------------------------------------------------------------------------------- ------------ End private function restoreFunctions().

                    } // ============================================================================ End public class PatientTabs{}.
                    } // ========================================================================================= End package{}.

                     

                    I know it's got to be something that I'm just overlooking or brain farting a piece of code somewhere. I need a fresh set of eyes to help me track it down.

                     

                    Thanks