0 Replies Latest reply on Apr 21, 2012 2:24 PM by x41dreams

    Timeline Slider Problem

    x41dreams

      hello,



      I'm having a problem with my timeline slider everything works great on it until I try and hide it when going to a new page in the flash. There are two pages, a homepage with the timeline and second page with the timeline hidden. When going to the second page I want to have the timeline slide off the document. When I do this it causes the timeline slider tab position to jump back to the beginning of the timeline before sliding off screen. I can't seem to figure out how to preserve the slider tab position before the timeline moves off screen.



      Originally the slider tab of the timeline animates onto screen using a traditional tween after running this as2:



      var enableTicker = false;



      var tickerMc:MovieClip = this.createEmptyMovieClip("tickerMc", this.getNextHighestDepth());

      tickerMc.onEnterFrame = function() {

      if(enableTicker) {

      if((timebutton._x > 35) && (timebutton._x <= 70)) {


      if((_root._currentframe != 46) && (_root._currentframe != 45)) {

      theframe = "frame1920";

      //_root.blender.gotoAndPlay(2);

      _root.gotoAndPlay(theframe);

      }


      }



      if((timebutton._x > 70) && (timebutton._x <= 140)) {

      if(_root._currentframe != 47) {

      theframe = "frame1930";

      //_root.blender.gotoAndPlay(2);

      _root.gotoAndPlay(theframe);

      }

      }

      if((timebutton._x > 140) && (timebutton._x <= 208)) {


      if(_root._currentframe != 48) {

      theframe = "frame1940";

      //_root.blender.gotoAndPlay(2);

      _root.gotoAndPlay(theframe);


      }


      }

      if((timebutton._x > 208) && (timebutton._x <= 275)) {


      if(_root._currentframe != 49) {

      theframe = "frame1950";

      //_root.blender.gotoAndPlay(2);

      _root.gotoAndPlay(theframe);


      }

      }


      if((timebutton._x > 275) && (timebutton._x <= 345)) {


      if(_root._currentframe != 50) {

      theframe = "frame1960";

      //_root.blender.gotoAndPlay(2);

      _root.gotoAndPlay(theframe);


      }

      }


      if((timebutton._x > 345) && (timebutton._x <= 413)) {


      if(_root._currentframe != 51) {

      theframe = "frame1970";

      //_root.blender.gotoAndPlay(2);

      _root.gotoAndPlay(theframe);


      }

      }

      if((timebutton._x > 413) && (timebutton._x <= 481)) {


      if(_root._currentframe != 52) {

      theframe = "frame1980";

      //_root.blender.gotoAndPlay(2);

      _root.gotoAndPlay(theframe);


      }

      }

      if((timebutton._x > 481) && (timebutton._x <= 547)) {


      if(_root._currentframe != 53) {

      theframe = "frame1990";

      //_root.blender.gotoAndPlay(2);

      _root.gotoAndPlay(theframe);

      }

      }

      if((timebutton._x > 547) && (timebutton._x <= 610)) {


      if(_root._currentframe != 54) {

      theframe = "frame2000";

      //_root.blender.gotoAndPlay(2);

      _root.gotoAndPlay(theframe);


      }

      }

      if((timebutton._x > 610) && (timebutton._x <= 690)) {


      if(_root._currentframe != 55) {

      theframe = "frame2010";

      //_root.blender.gotoAndPlay(2);

      _root.gotoAndPlay(theframe);


      }

      }

      }

      //trace(timebutton._x);


      }









      At the end of the tween the slider tab has this as2:











      on (press) {

      if(init) {

      startDrag("timebutton", false, 32, 440, 637, 440);

      if(!dragHelpInit) {

      dragHelpInit = true;

      _root.dragHelp.gotoAndPlay("hideDrag");

      }

      }

      dragging = true;

      usingDrag = true;

      }

      on (release) {

      if(init) {

      stopDrag();





      if((timebutton._x > 31) && (timebutton._x <= 100)) {


      if((_root._currentframe != 46) && (_root._currentframe != 45)) {

      theframe = "frame1920";

      _root.blender.gotoAndPlay(2);


      }


      }





      if((timebutton._x > 100) && (timebutton._x <= 170)) {

      trace("i'm here");

      if(_root._currentframe != 47) {

      theframe = "frame1930";

      _root.blender.gotoAndPlay(2);

      trace("and here");

      }

      //_root.gotoAndStop("frame1930");

      }

      if((timebutton._x > 170) && (timebutton._x <= 235)) {



      if(_root._currentframe != 48) {

      theframe = "frame1940";

      _root.blender.gotoAndPlay(2);

      }


      }

      if((timebutton._x > 235) && (timebutton._x <= 303)) {



      if(_root._currentframe != 49) {

      theframe = "frame1950";

      _root.blender.gotoAndPlay(2);

      }

      }



      if((timebutton._x > 303) && (timebutton._x <= 373)) {



      if(_root._currentframe != 50) {

      theframe = "frame1960";

      _root.blender.gotoAndPlay(2);

      }

      }


      if((timebutton._x > 373) && (timebutton._x <= 443)) {



      if(_root._currentframe != 51) {

      theframe = "frame1970";

      _root.blender.gotoAndPlay(2);

      }

      }

      if((timebutton._x > 443) && (timebutton._x <= 508)) {



      if(_root._currentframe != 52) {

      theframe = "frame1980";

      _root.blender.gotoAndPlay(2);

      }

      }

      if((timebutton._x > 508) && (timebutton._x <= 573)) {



      if(_root._currentframe != 53) {

      theframe = "frame1990";

      _root.blender.gotoAndPlay(2);

      }

      }

      if((timebutton._x > 573) && (timebutton._x <= 630)) {



      if(_root._currentframe != 54) {

      theframe = "frame2000";

      _root.blender.gotoAndPlay(2);

      }

      }

      if((timebutton._x > 630) && (timebutton._x <= 720)) {



      if(_root._currentframe != 55) {

      theframe = "frame2010";

      _root.blender.gotoAndPlay(2);

      }

      }

      trace(timebutton._x);

      dragging = false;

      }

      }



      Now when I try to animate it off screen it obviously jumps back to the initial position because I'm basically just using the same key frames, but reversed. Does anyone know how I can preserve the position of this slider tab?