4 Replies Latest reply on Apr 15, 2010 10:14 AM by Ned Murphy

    Animation gets stuck on rotation in Flash CS4

    willkanoff

      Hi everybody.

      Here is my problem.

       

      I have 1656x1332 px 30fps movie clip sliding or rotating on click event inside of 850x550 px stage. For some reason the clip gets stuck on rotation sometimes, even though the whole file is only 46 KB. Moreover, depending on browser, the rotating part can fly completely off the stage and the only way to get it back is to refresh. Could someone please help me to figure out what's going on here?

       

      Here is the code:

       

       

      import fl.transitions.Tween;

      import fl.transitions.easing.*;

      //animating transitions

      function contentMover(contentXPosition:Number, contentYPosition:Number, contentRotation:Number, loadSection:String):void{

      var contXTween:Tween = new Tween(content, "x", Regular.easeOut, content.x, contentXPosition, 1, true);

      var contYTween:Tween = new Tween(content, "y", Regular.easeOut, content.y, contentYPosition, 1, true);

      var contRotationTween:Tween = new Tween(content, "rotation", Regular.easeOut, content.rotation, contentRotation, 1, true);

      mainLoader.source = loadSection;

      }

      //activating - disactivating navigation buttons

      function buttonActivator(homeButton:Boolean, aboutButton:Boolean, portfolioButton:Boolean, contactButton:Boolean):void{

      content.home_btn.enabled = homeButton;

      content.about_btn.enabled = aboutButton;

      content.portfolio_btn.enabled = portfolioButton;

      content.contact_btn.enabled = contactButton;

      }

      //button opacity

      function opacity(homeBtn:Number, aboutBtn:Number, portBtn:Number, contactBtn:Number):void{

      content.home_btn.alpha = homeBtn;

      content.about_btn.alpha = aboutBtn;

      content.portfolio_btn.alpha = portBtn;

      content.contact_btn.alpha = contactBtn;

      }

      buttonActivator(false, true, true, true);

      //listening for button click events

      content.home_btn.addEventListener(MouseEvent.CLICK, homeClick);

      function homeClick(e:Event):void {

      contentMover(-666, -604, 0, null);

      opacity(1,1,1,1);

      buttonActivator(false, true, true, true);

      }

      content.about_btn.addEventListener(MouseEvent.CLICK, aboutClick);

      function aboutClick(e:Event):void {

      contentMover(-778, -410, 0, "about.swf");

      opacity(1, .5,1,1);

      buttonActivator(true, false, true, true);

      }

      content.portfolio_btn.addEventListener(MouseEvent.CLICK, portfolioClick);

      function portfolioClick(e:Event):void {

      contentMover(-526, -676, 0, "portfolio.swf");

      opacity(1,1,.5,1);

      buttonActivator(true, true, false, true);

      }

      content.contact_btn.addEventListener(MouseEvent.CLICK, contactClick);

      function contactClick(e:Event):void {

      contentMover(-672, 1380, -90, "contact.swf");

      opacity(1,1,1,.5);

      buttonActivator(true, true, true, false);

      }

       

      Thanks!