A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: reverse timeline control

  1. #1
    Senior Member
    Join Date
    Dec 2000
    Posts
    123

    reverse timeline control

    i've found tutorials on playing timelines in reverse, but all of the ones i've found play in reverse to the beginning (unless you manually stop it).

    maybe i've not been lucky to find the right tutorial?

    my timeline has stopping points at regular intervals (it's a slideshow of sorts)... currently, my "back" button just jumps back to the previous stopping point and i'd like to reverse play to the stop point... i'm attaching a screen shot...

    does this make sense?


  2. #2
    Ryan Thomson EvolveDesigns's Avatar
    Join Date
    Oct 2001
    Location
    British Columbia
    Posts
    3,338
    I assume the backwards code is something like

    this.onEnterFrame = function(){
    prevFrame();
    }

    if you needed that to stop at a certain frame you would add an if statement

    this.onEnterFrame = function(){
    prevFrame();
    if(_currentframe == 20){
    delete onEnterFrame;
    }
    }
    Evolve Designs Interactive Media
    the natural selection

  3. #3
    Senior Member
    Join Date
    Dec 2003
    Posts
    158
    Hi i've been trying to do something like this, only using fades as the transitions. For this reason, I need the buttons to take the user back to the frame after the fade, so that when it rewinds it fades straight away, rather than sitting on the current image. I've had a little success, in that I can make it rewind then hit frame 100, remove the rewind function, lands on a play(); function to start the animation off again using:

    PHP Code:
    on (release) {
        
    this.onEnterFrame = function(){
    prevFrame();
    if(
    _currentframe == 100){
        
    delete onEnterFrame;
    }
    }

    I can then get it to rewind with the transition immediately by replacing the code with:

    PHP Code:
    on (release) {
        
    this.onEnterFrame = function(){
    prevFrame();}

    if(
    _currentframe 250 || _currentframe 450){
        
    gotoAndPlay(250);
    }

    But if I try and put the code together:

    on (release) {
    this.onEnterFrame = function(){
    prevFrame();}
    if(_currentframe == 100){
    delete onEnterFrame;

    if(_currentframe > 250 || _currentframe < 450){
    gotoAndPlay(250);
    }
    }
    }
    The following probably gives me the best result:

    PHP Code:
    on (release) {
        
    this.onEnterFrame = function(){
    prevFrame();}
    if(
    _currentframe == 100){
        
    delete onEnterFrame;}
        
    if(
    _currentframe 250 || _currentframe 450){
        
    gotoAndPlay(250);
    }

    It rewinds at the transition immediately and stops at frame 100, but it doesn't then play, it just sits there.

    I just can't get it to work properly.

    Anyone got any ideas at all? Much appreciated!

    Cheers
    That which does not kill us makes us stronger

  4. #4
    Ryan Thomson EvolveDesigns's Avatar
    Join Date
    Oct 2001
    Location
    British Columbia
    Posts
    3,338
    I can't figure what this is trying to do.. if you could post an example fla i'll take a gander.

    That said I do see room for error in your code.

    this line:
    PHP Code:
    if(_currentframe 250 || _currentframe 450){ 
    would be better said:
    PHP Code:
    if(_currentframe 250 && _currentframe 450){ 
    That way both those conditions would need to be met rather than either. The reason for this is this part '_currentframe < 450' would be met even on frame 100 which might be messing with your 'currentframe == 100' as on frame 100 the code is saying to delete the onEnterFrame but also saying to gotoFrame 250 in the next part.

    I'm prlly way off, but yeah, feel free to post an example.
    Evolve Designs Interactive Media
    the natural selection

  5. #5
    Senior Member
    Join Date
    Dec 2003
    Posts
    158
    On iPhone so can't post example just yet, basically though, between frames 250 and 450 is the slide that will be showing. During this point there will be no transition, so if the button is pressed between this point, it goes back to the previous transition and then plays back until it reaches frame 100 and begins to play forward until a button is pressed again.
    That which does not kill us makes us stronger

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center