dcsimg
A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: prevframe? help it wont work

  1. #1
    Senior Member
    Join Date
    Aug 2002
    Posts
    111

    prevframe? help it wont work

    is there a way to tween backwards on rollout...cuz im doing a button on rollover gotoAndPlay 2 and on rollout PrevFrame(); how do i get to treew back???? help please thanks

  2. #2
    Senior Member
    Join Date
    Aug 2002
    Location
    Dublin, Ireland
    Posts
    1,749
    You might be able to adapt this.

    What it does is create an onEnterFrame function that navigates to previous frame each time when the direction is backwards or navigates to the next frame if the direction is forwards.

    There is some more gubbins in there to allow you to set speeds as well, but hey, some days ...

  3. #3
    Senior Member
    Join Date
    Aug 2002
    Posts
    111
    thats cool...but um isnt there simpler code than that...usALLY I DONT UNDERSTAND UNLESS I ROTE IT..oops sorry bout the caps.um what if i send u the fla and tell u what i want the u fix it then ill understand it maybey...

  4. #4
    Senior Member
    Join Date
    Aug 2002
    Posts
    111
    cuz what i did was a while loop heres the code i have

  5. #5
    Senior Member
    Join Date
    Aug 2002
    Posts
    111
    the code is

    onClipEvent (enterFrame) {
    this.onRollOver = function() {
    this.gotoAndPlay(2);
    };
    this.onRollOut = function() {
    do {
    prevFrame();
    } while (this._currentframe > 1);
    };
    }
    thats on the mc

  6. #6
    Senior Member
    Join Date
    Aug 2002
    Posts
    111

    help???? please

    please help me

  7. #7
    Senior Member
    Join Date
    Aug 2002
    Location
    Dublin, Ireland
    Posts
    1,749
    Your problem is that the prevFrame action only occurs when you are rolling over or rolling out.

    Try this:

    PHP Code:
    this.onRollOut = function() {
        
    this.onEnterFrame go_backward;
    };
    function 
    go_backward() {
        if (
    this._currentframe>1) {
            
    prevFrame();
        }
    }
    this.onRollOver = function() {
        
    delete this.onEnterFrame;
        
    this.gotoAndPlay(2);
    }; 

  8. #8
    Senior Member
    Join Date
    Aug 2002
    Posts
    111
    nice thanks man that works

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