Scrolling Forward and Backward issue

I have a movie in FlashMX that I am using an actionscript to scroll the scene forwards and backwards that I got from monitoring posts on this forum (thanks, I usually solve my problems and learn just from searching posts).

The script follows:

onEnterFrame = function() {
if (this._currentframe == 1) {
playMe = true;
}
if (this._currentframe == this._totalframes) {
playMe = false;
}
if (playMe == true) {
this.nextFrame();
}
if (playMe == false) {
this.prevFrame();
}
};

The problem I encounter is that the scene will scroll down and back then stop, rather than continue to scroll back and forth continuously.

I believe the reason has to do with the fact that I have this script on the first frame of the second scene of the movie. The first scene plays then has a goTo action on the last frame to go to frame 1 of the second scene. However, I don’t what to do to fix it.

Help is appreciated. If you want to see the .fla file, let me know and I will post it.

Thanks.

can you post your fla so i can see plz…!?

this is what i think you wanna do…you just want the scene to automatically change and go to the next after some time right?

or do you want to have a button that changes from scene to scene?!

sorry i’m not too sure wat you wanna do…

Actually, after the first scene plays, it automatically jumps to the next scene and plays. The next scene has a script that makes it run through the scene’s frames forward, then play in reverse. The script, is supposed to continously loop the scene’s frames forward and backward. But what happens is that the (second) scene plays forward then backward then stops at scene 1. The reason I have a first scene, is so that the movie intially “scrolls” in at a faster rate than it “scrolls” continously.

The .fla is attached.

Now this movie is loaded into a target in the main movie, but that should not make a difference.

You can check it out in action at http://www.artifactdesigngroup.com/

The .fla is at http://www.artifactdesigngroup.com/2functional.fla

Just so you know, this is not a paid project. I am helping my best friend build a cool website for his company.

Thanks.

I don’t believe you can run this script across multiple scenes, it only works in one timeline.

lostinbeta,

thanks for checking out my question and the quick reply.

do you mean that because the movie contains two scenes that the script won’t work for playing forward and in reverse continuously for the second scene only?

or do you mean that it won’t play forward and reverse, and between the scenes as well?

i am not trying to get it to go forwards and reverse between scenes; only forward and reverse continuously within the second scene.

Ok, I waited to see what exactly happened and now I see.

When it scrolls backwards it stops at frame1 of scene 2, but what you want is for it to play over again right?

Well this is an easy fix. Just right click on Frame 2 of the “actions” layer and choose “Insert Blank Keyframe” so a blank keyframe with is in frame 2.

Then change the code in Frame 1 to this…

this.onEnterFrame = function () {
	if (this._currentframe == this._totalframes) {
		playMe = false;
	}
	if (playMe == true) {
		this.nextFrame();
	}
	if (playMe == false) {
		this.prevFrame();
	}
};
playMe = true;

I don’t believe with Scenes the 2nd Scenes frame 1 is actually frame 1, so what I did instead was just added playMe = true directly to the frame instead of in an if statement checking to see if the current frame was frame 1.

It worked great.

lostinbeta,

that was it. the tweek did have to do with the fact that you set it up not to look for “frame 1” to start playing forward again.

thanks for the help.

most of the threads i look up seem to have you posting some type of solution.

Eh, I try :slight_smile:

Sometimes my solutions aren’t always efficient, and sometimes they don’t work, but I try to expand my knowledge by helping/trying to help other people solve their problems.

I am glad you got it working!