prevFrame(); --> how do I move more than one frame back?

[AS]onClipEvent (enterFrame) {
if (_root.mario.hitTest(this)) {
if(!this.addtohealth){
_root.health.prevFrame();
this.addtohealth ;
}
this.gotoAndStop(“done”);
}
}
[/AS]

I have this code…And it works fine only I want to move say 3 frames back instead of one. So I tried the below script

[AS]onClipEvent (enterFrame) {
if (_root.mario.hitTest(this)) {
if(!this.addtohealth){
_root.health._currentframe - 3
this.addtohealth ;
}
this.gotoAndStop(“done”);
}
}
[/AS]

But that didn’t work…So If anyone knows how I can move more than one frame back it would be a big help! Thanks in advance :).

Hey Fargate! Hows things at NG? Any new animations from Sherb (known for star and coffee and parachute) or any Johnny Rocketfinger series? Did you make any new games yet?

Oh yea, did Pimp Quest II come out yet?


You should always remember to shorten codes and end statements:

onClipEvent (enterFrame) {
        if (_root.mario.hitTest(this) && !this.addtohealth) {
                        _root.health.gotoAndStop(_root.health._currentframe -  3);
                        this.addtohealth;
                }
                this.gotoAndStop("done");
}

  • Not sure if this will work but give it a try!

use this
_root.health.gotoAndStop(_root.health._currentframe - 3)

There is another way…

onClipEvent (enterFrame) {
        if (_root.mario.hitTest(this) && !this.addtohealth) {
            for (i = 0; i < 4; i++) {
                _root.health.prevFrame();
            }
                this.addtohealth;
        }
        this.gotoAndStop("done");
}

Untested…but give it a try.

Ah right Flash4Food I should have though of that…Thanks very much.

And to answer your questions Sharif no I don’t think so… and I’ve only released 1 new tutorial so far on masking individual mc’s with AS. I hadn’t gone there in awhile so. In terms of games I’ve made a mario based platformer which includes everything you could possibly think of…

I stopped going there…too much p*rn and ads. Killed my poor cheap compaq.

lol…it’s not that bad anymore actually…I think it used to be at one point but they toned it down a bit…