7 Replies Latest reply on Aug 4, 2009 9:03 PM by ericscd

    Random stopping

    ericscd

      When I play file locally, as in preview it through Fl CS4 it views fine all the buttons work and everything transitions smoothly. However, when I view it in Firefox or Google Chrome I get bizarre stops that occur as a fade transition is happening. When I the file in IE, everything appears to to transition smoothly.

       

      the file can be found at www.ericschuppe.com/website.html

       

      -Where the problem occurs when you transition between buttons(I.E clicking About then Portfolio then Contact usually the fade doesn't finish tweening), usually will only happen the first time you click
      -I've tried different computers, versions of browsers..all same issue
      -Re-exporting doesn't work
      -I've tried editing the actionscript that controls the fade when the button is clicked
      I can post sections of code if you need that

       

      Thanks ahead of time,
      Eric

        • 1. Re: Random stopping
          kglad Adobe Community Professional & MVP

          it looks like you're not checking to see if there's an ongoing transition when a new one starts and that's causing a problem.  you need to stop any previous transition that might be occuring when you start a new transition.

          • 2. Re: Random stopping
            ericscd Level 1

            I don't quite understand, I tried removing the other two tranistions(tabContainer,texttConainer) that happen when you click the button but the issue still isn't solved. Is it the button transition that is causing this?

            Would it be helpful if i posted my FLA?

            Thanks again,

            Eric

            • 3. Re: Random stopping
              kglad Adobe Community Professional & MVP

              that won't stop the problem if you repeatedly click the same button that does have a transition.

               

              to remedy, stop the previous transition when a current one is about to start.

              • 4. Re: Random stopping
                ericscd Level 1

                I think I understand what you're saying.

                 

                I the way I do the transitions is:

                btnhome.addEventListener(MouseEvent.CLICK, btnhomeClick);
                function btnhomeClick (event:MouseEvent):void {
                var btnhomeOutro:Tween = new Tween(pageContainer_mc, "alpha", Strong.easeOut, 1, 0, .75, true);
                btnhomeOutro.addEventListener(TweenEvent.MOTION_FINISH, runBtnhomeTransition);
                function runBtnhomeTransition (event:TweenEvent):void {
                pageContainer_mc.removeChildAt(1);
                pageContainer_mc.addChild(hp);
                var btnhomeIntro:Tween = new Tween(pageContainer_mc, "alpha", Strong.easeOut, 0, 1, .75, true);
                }
                }
                

                Is this incorrect or should there be a stop(); or this.stop somewhere?

                Thanks again kglad I appreciate the help a lot!

                • 5. Re: Random stopping
                  kglad Adobe Community Professional & MVP

                  1.  never ever nest anonymous functions.

                   

                  2.  try:

                   

                  btnhome.addEventListener(MouseEvent.CLICK, btnhomeClick);
                  var btnhomeOutro:Tween
                  var btnhomeIntro:Tween

                   

                  function btnhomeClick(event:MouseEvent):void {
                      if(btnhomeOutro!=null){
                          btnhomeOutro.stop();
                      }
                      if(btnhomeIntro!=null){
                          btnhomeIntro.stop();
                      }
                      btnhomeOutro = new Tween(pageContainer_mc, "alpha", Strong.easeOut, 1, 0, .75, true);
                      btnhomeOutro.addEventListener(TweenEvent.MOTION_FINISH, runBtnhomeTransition);
                  }

                   

                  function runBtnhomeTransition(event:TweenEvent):void {
                      pageContainer_mc.removeChildAt(1);
                      pageContainer_mc.addChild(hp);
                      btnhomeIntro = new Tween(pageContainer_mc, "alpha", Strong.easeOut, 0, 1, .75, true);
                  }

                  • 6. Re: Random stopping
                    ericscd Level 1

                    Thank you so much kglad! That answer was spot on, you were incredibly helpful.

                    • 7. Re: Random stopping
                      kglad Adobe Community Professional & MVP

                      you're welcome.