0 Replies Latest reply on Aug 16, 2006 9:24 AM by RSHerhuth

    Overriding a timeline animation with a rollover event

    RSHerhuth
      Hi,

      I have a flash app where I have an animation on the main timeline. It basically pauses on each frame for a specified amount of time then jumps to the next frame (no magic here!). There sre 5 buttons on the main timeline that on rollover I would like them to intrupt the animation and send the playback head to frame 1 on mouseover. If there is no activity in the form of rollovers for a specified amount of time, I want to start the animation loop again until another rollover event occurs.

      This is the code I have tried which gives erratic results:

      Main Timeline Frame code:
      // moves the display text associated with each button offstage
      _txtClipInstance1._y = 1310.0;
      _txtClipInstance2._y = 1310.0;
      _txtClipInstance3._y = 1310.0;
      _txtClipInstance4._y = 1310.0;
      _txtClipInstance5._y = 1310.0;
      updatestage();

      // Pauses the movie for 14 seconds
      stop();
      var interval:Number = setInterval(function () {
      play();
      clearInterval(interval);
      }, 14000);



      A sample button script:
      on (rollOver)
      {
      // Send the playbackhead to Frame1 (works sometimes but not always
      _level0.gotoAndStop(1);

      // Moves all of the text fields associated with the buttons offscreen
      _txtClipInstance1._y = 1310.0;
      _txtClipInstance2._y = 1310.0;
      _txtClipInstance3._y = 1310.0;
      _txtClipInstance4._y = 1310.0;
      _txtClipInstance5._y = 1310.0;
      updatestage();

      // Sets the Alpha to 50 on all the non selected buttons
      _btnInstance1._alpha=50;
      _btnInstance3._alpha=50;
      _btnInstance4._alpha=50;
      _btnInstance5._alpha=50;

      // Moves the text associated with the selected button on screen
      _txtClipInstance2._x = 180.5;
      _txtClipInstance2._y = 290.0;
      updatestage();
      }

      on (rollOut)
      {

      // Returns the alpha back to 100 on all buttons
      _btnInstance1._alpha=100;
      _btnInstance2._alpha=100;
      _btnInstance3._alpha=100;
      _btnInstance4._alpha=100;
      _btnInstance5._alpha=100;
      updatestage();

      // Moves the text associated with this button back offstage
      _txtClipInstance2._x = -435;
      _txtClipInstance2._y = 142.0;
      updatestage();

      }

      on (release)
      {
      getURL("ProductSuite_Main.aspx","_self");
      }


      Is there an easier way to do this? Or am I missing something that might be causing the erratic behavior?

      Thanks for any assistance you might be able to provide.
      Ron