Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Next Frame And Previous Frame Buttons



I've got most of the details of my new site figured out but my next frame and previous frame buttons aren't working quite right.
Code:
on (release) {tellTarget("/content") if (this._currentframe == this._totalframes) { gotoAndStop(1); } else { nextFrame(); } }
and
Code:
on (release) {tellTarget("/content")if (this._currentframe == 1) { gotoAndStop(this._totalframes); } else { prevFrame(); } }
The buttons don't work consistently in the first lable, and on the following lables they go forward and back but don't infact loop back to frame one or the last frame. Please take a look and help. Thanks http://dxyner2000.com/flash_page/portfolio.htmlpage http://dxyner2000.com/flash_page/portfolio.flafile



KirupaForum > Flash > Flash 8 (and earlier) > Flash MX
Posted on: 03-28-2005, 10:02 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Next Frame And Previous Frame Buttons
I've got most of the details of my new site figured out but my next frame and previous frame buttons aren't working quite right.


Code:
on (release) {tellTarget("/content")
if (this._currentframe == this._totalframes) { gotoAndStop(1); } else { nextFrame(); } }
and


Code:
on (release) {tellTarget("/content")
if (this._currentframe == 1) { gotoAndStop(this._totalframes); } else { prevFrame(); } }
The buttons don't work consistently in the first lable, and on the following lables they go forward and back but don't infact loop back to frame one or the last frame.

Please take a look and help. Thanks

http://dxyner2000.com/flash_page/portfolio.html
page

http://dxyner2000.com/flash_page/portfolio.fla
file

Previous Frame Overlay..... Frame By Frame By Frame By Frame By Frame By.....
Hello there.

I am trying to create a small animation just as a little bit of fun. I would like to do it frame by frame.

I have a simple question to ask about frame by frame animation.

When drawing frame by frame, you would usually have a transparent overlay that you can compare with the next frame. Is there a way to do this in flash without having to copy the previous keyframe into a new keyframe on a new layer?

Thanks Emdiesse

Previous Frame/next Frame Issues Giving Me Big Problems
This question is regarding the previous frame / next frame command and how to control the range of frames in can effect.

I have a situation in Flash where I am controlling another, externally loaded SWF file via the previous and next frame command. The externally loaded SWF is a sequence of bitmap graphics with a stop command on each frame and a two frame preloader sequence in a separate scene (scene 1). Let’s call this externally loaded file images.swf for the sake of clarity.

In my main Flash sequence, I have two arrow buttons with a message telling the user to press either arrow button to begin. The first button press of either arrow button does two things: first, it loads images.swf into a empty movie clip (“emptyMC”) and second, it brings users to the next frame in my main Flash sequence, which is exactly the same as the one before it with the one exception that there is now a different action applied to both arrow buttons.

So Flash is now on the next frame of the main Flash sequence - to the user the only visual difference is now they are now viewing the preload graphic in the display area where “emptyMC” is. When the preloader is all done, users see the first frame of images.swf loaded into the “emptyMC” box.

Now when users press the right arrow button they move the frame head on images.swf ahead by one to the next bitmap because the right arrow button in the main Flash sequence now has the following action attached to it:
on (release) {
tellTarget ("emptyMC") {
nextFrame();
}
}
(the action for the left arrow button is the same except it’s a previousFrame command.)

This lets users scroll through the bitmaps in the externally loaded image.swf using the right and left arrow button in the main flash document.

Here’s the problem:

After users have loaded images.swf and are scrolling back and forth using the left and right arrow buttons, if they are at the first bitmap in images.swf (frame 3, since there is a 2 frame preloader) and press the left arrow button (with the previousFrame action attached to it) they are now brought back to the preloader. This is no good – I don’t want users to be able to scroll back to the preloader over and over again. Is there any way to tell Flash via action script, “this button when pressed brings you to the previous frame of X unless X is at frame 3, in which case do nothing when the button is pressed.”?

I hope I’m being clear here. I’m new to Flash, especially actionscripting, so I might be over-complicating things here.

One other question : When the user reaches the last frame of images.swf and presses the right arrow button (nextFrame) in the main Flash sequence, I was hoping to have a graphic that displayed that says something to the extent of “Last frame, please press the back arrow”, and then automatically brings you back one frame after a few seconds. Is there a way in actionscript to say in essence, “previousFrame after 5 seconds”?

If anyone wants to check out the file in question, head to www.nilsd.com/index2.htm When the Flash doc loads, select “Multimedia” then select “Design” (it’s the only path close to completed at this point) This will hopefully give you a better sense of what I am trying to do.

Thanks in advance for any and all help.

Nils
images.swf

Quick Button Question Next Frame And Previous Frame
hey there, just a quick problem im hoping someone can help me with please?

ive got this code on a button:


Code:
on (press) {
newDepth++;
var h = box.createEmptyMovieClip("holder"+newDepth, newDepth);
h.loadMovie("vanda.swf", "_root.holder"+newDepth);
preLoader(h);
}
have then got this code on another button in the same timeline as above with this code:




Code:
on (press) {
_root.bar.buttons.box.holder+newDepth.gotoAndStop(nextFrame);
}
i would like these buttons to tell whatever swf has been loaded into the empty movie clip to go forward one frame and stop and backward one and stop? am i close?

Showing Previous Frame Transparent On Current Frame?
I am drawing all my flash out by hand, and wondered if there was an option that showed the previous frame transparently on the current frame to guide me. This would make things sooo much easier. Does Flash offer any option like this?

Values In A Frame Depend On Selected Value In A Previous Frame
Hello,
I make a flash reading images and text from an xml file.i would like every time someone press a button at a frame to keep the selected value connected with the button and go to frame in which the values (text + image) from xml file that appears depend on the previous selected value. Any proposal?
Thank you very much.

Showing Previous Frame Transparent On Current Frame?
I am drawing all my flash out by hand, and wondered if there was an option that showed the previous frame transparently on the current frame to guide me. This would make things sooo much easier. Does Flash offer any option like this?

Next Frame & Previous Frame Coding Help
Im basically creating a special flash photo app, where there will be the main area where the image loads, then there will be 2 arrows below, 1 going left the other going right. So a main window, and 2 arrow buttons beneath, quite simple. But my problem is, Im having trouble finding that coding to goto the "next frame" or the "previous frame) so i could put that coding on the buttons. Fairly easy, i just cant find the AS references for this sort of coding.

Basically I will be taking photos of this client's product going 360 degree's around the object. Now I've seen apps on threads on these forums with regards to creating apps in the same sort of way, that can be controlled frame-by-frame with some simple actionscripting, any examples, tutorials, .fla's or even links to helpful threads would be great ! thnx.

Script For Control Buttons To "jump To And Back" The Previous Or Next Labelled Frame
Urgent Request please !!
I have created a movie within a main movie that has five sections. Each section is flagged with a labelled frame at the beginning. I want the user to be able to use the "step back and step forward " control buttons to move the playhead to the last played or next labelled frame.

I believe this is possible with the use of action scripting in Flash 5.

Thanks for your help.

Cheers,

Sunny_skye

Go To Previous Frame?
Hi there.
I have some KEY frames in one of the scenes of my flash movie.
This is what I need:
Every key frame has one SPECIAL button that takes the user to the 30th frame of the scene where I put a text that explains all the calculations on the scene that he is in. As the user finishes reading the text there's a GO BACK button that would have to take the user to the SAME key frame that he was before.
****** IS THAT POSSIBLE?? IF SO, HOW DO I DO THAT?? ******
Please contact me if you need any extra information...
tks!

Previous MC Certain Frame
after loading a MC, how can from this MC i can get back to the previous MC the same frame that i came from ??

Previous Frame
Hi,

I have made a "fancy" slide show with Flash MX and I want to reference 1 slide (1 frame) from a bunch of different slides. I want to be able to put a back button on this slide. Is there a way to know what frame (slide) that I came from so that I can back to it when I click the back button? If you have any questions, please ask.

-Nathan

Next Frame But Not Previous?
I have a movie, in which there are buttons labelled "previous frame" and "next frame". The code for "previous frame":

on(release) {
gotoAndPlay(_currentFrame-1)
}

The code for "next frame" is the same, except changing the minus sign to a plus sign. However, only "next frame" works. Anyone can help?

Previous Frame
What is the script used to go to previous frame viewed as opposed to (see below) previous frame on timeline?

on (release) {
prevFrame();

Next Frame But Not Previous?
I have a movie, in which there are buttons labelled "previous frame" and "next frame". The code for "previous frame":

on(release) {
gotoAndPlay(_currentFrame-1)
}

The code for "next frame" is the same, except changing the minus sign to a plus sign. However, only "next frame" works. Anyone can help?

Previous Frame
What is the script used to go to previous frame viewed as opposed to (see below) previous frame on timeline?

on (release) {
prevFrame();

State Of A MC On Previous Frame ?
I have 2 MCs MC1 and MC2 ( MC1 Contains details and MC2 is a Menu system)

On MC1(Frame "normal") is code:
on (release) {
gotoAndStop ("big");
setProperty ("/MC2", _visible, "0");
}

Frame "big" is a fullscreen version of previous slide.

If user set MC2 "visible.0" when at frame "normal", what code can I put on "big" so that MC2 is still visible.0 ?

If user set MC2 visible.1 when at frame "normal", what code can I put on "big" so that MC2 is still visible.1 ?

Hop someon can help

Kathy

Previous Frame Loop?
hi!.. i got a problem with playing frames backwards...
i can goto the previous frame on rollover but only 1 frame, how do i keep going to previous frames until my mouse leaves the button??

thanks in advance,
Martijn.

Returning To Previous Frame
Question about returning to previous frame:

How can I come back to the frame I was after I go to another frame on the same scene?

Kinda hard to elaborate.

Let´s say I'm in frame 1,2 or 3. Then I click a button and go to frame 4. How can I come back to the frame I clicked at first (1, 2 or 3)? I´m not talking programing to go back to a specific frame.

Thanks.

How Do I Tell Level0 To Go To The Previous Frame?
Here is the story. My main interface is on level 0,

there are two buttons in my interface.

When you click them, a new swf file is loaded onto level 1.

The only problem was that, the buttons on level 0 were still active even though they were covered by my swf on level 1.

So, I did the following....

For the button on my main interface, I said,

on release

loadmovie, whatever.swf onto level1

goto next frame.


---So...I sent the level0 to the next frame, which was blank, so that it's buttons wouldn't be active underneath the new movie I brought in.

NOw, how do I get it to go back?

I have an exit button on my loaded swfs. The code on it just says to unload level 1.

How do I tell level 0 to go back one frame?

What methods can I use to achieve this?

What is the proper code to address level 0, and to tell it to go back a frame?

Thanks.

Button Goes To Previous Frame
I have a button called Gear. It is on frame 1 and frame 2. Both times when clicked, it will take you to a frame called gear. On the gear frame there is a button called back. I want it to take you to frame 1 if you came from frame 1 or frame 2 if you came from frame 2. How do you do this?

Thanks

Return To Previous Frame?
To smart people:

I am creating a tutorial in Flash, simple interface, and I am stuck.

I am a very new coming Flash person. (2 months) I have created a movie that I want to return to the previous frame from a given set of 9 buttons.
I have a "scrollPane" filled with movieClip "a" on frame 1, the first nine buttons vertically scroll the scrollPane to a selected location. The tenth button jumps to the second frame where the a scrollPane is filled with movieClip "b". That is as far as I have gotten.

I want to be able to click any of the first nine buttons in the second frame and return to the first frame following the script associated with the button.

Remember, I am very new to actionscripting and am just guessing at what the code might be. I have tried many varioations of statements and code. Here is a sample of the code I tried on the nine buttons:

on (release) {
if(_currentframe==2);
gotoAndStop(1);
tb1_cp.vPosition=204;
}

Also, how do I post my .fla in this message so you can see it?

Joe

Button To Go To Next/previous Frame
Hello there.
I'm making a small site in flash which contains some basic scripting, and I ran into a problem. I'm trying to make 2 buttons (<<< and >>>) to browse through a certain part of this site, and clicking the button would bring you to the previous/next frame in the timeline.

My script in these frames is as follows:

stop();
achteruit.onRelease = function() {
_root.gotoAndPlay(prevFrame);
}
vooruit.onRelease = function() {
_root.gotoAndPlay(nextFrame);
}

And the problem is simple: whenever I click the button nothing at all happens. I checked all my tags but they appear to be right.
Any ideas what I'm doing wrong?

ActionScript To Go To Next/previous Frame
I am creating my first Flash website and all I need is the AS for a next and back button for my image gallery. I want to click on the "next button" and go to the next frame in the timeline, click "back button" and go back to the previous image/frame. I am using AS3. Thanks for the help

How To Go To Last Frame - Not Sequentially Previous?
I have a frame I'll call "FrameX" that I am accessing from other frames within the same swf, and I want to be able to tell the playhead to go back to the frame it was in before it came into FrameX - how do I do this? arghh.

On Release Go To The Previous Frame
Hello...i was wondering if you can help me figure this out....

This is the code for a button that it tells it to go to the next frame

on (release){
_level0.play();
}

Whats the code to tell the button to go to the previous frame?



Thnak you for your time

Return To Previous Frame
Hi,

So I have five buttons which contain S1 animation for roll over then S2 for roll out and S3 where the hit area is missing and the button is not clickable.

So I want on release the animation for Button 1 to stop at S3, so the button to be not clickable and when I click Button 2, Button 1 to return at frame 1

Here is the code. What else I need to add to return the button on frame one when another button is selected

on (rollOver) {
gotoAndPlay("s1");
}
on (releaseOutside, rollOut) {
gotoAndPlay("s2");
}on (release) {
this._parent.gotoAndPlay(3);


//Movieclip GotoAndPlay Behavior
this.gotoAndPlay("s3");
//End Behavior
}

Getting To Previous Scene And Frame
Hey...once again, I thought I knew what I was doing, but its not working so I guess I dont. when the playhead enters a frame, I would like to have it go to the 1st frame of its container movieclip.
How can I do that? I tried "prevscene" but it just sends the playhead back to the first frame and not to the first frame of the movie that the actions are in.

So, I have a movie clip called "blue_mc", "chooseblog" lives in "blue_mc". I want to put an action on a frame inside "chooseblog" that goes to the 5th frame of "blue_mc." How can I do that?
Please help
Thanks in advance...
D

Clear Previous Frame
Hi, I have a problem and I was hoping you guys can help me.

I am trying to create a training site, the way it works is that it will run through some information and then there is a quiz at the end of different sections. I have the information in the way I want it, and the quiz is in place and works properly too, the only problem I am having is when the quiz gets to the end and it is displaying your score on the quiz, the last question of the quiz will remain on the screen for the rest of the presentation.

I have the training content and the quiz on different layers and I have tried ending it on one frame and then having a button to bring you another frame for the score, but it will just stay at the frame with the last question.

Any suggestions?

Thanks in advance!!!

How To Get Previous Frame Label
I have several frame label in a movie. The timeline jumps from one frame to other on button click. On every frame I want to get the label of the frame, timeline has come from. How to?

To make it more clear suppose I have three frame labeled as A(frame 1), B(frame 2), and C(frame 3). On all these frames I have stopped(using stop()) the timeline. On first run timeline is on frame 1(i.e. A). Now it jumps on frame 3(i.e. C). Here I have to get the label of frame 1 i.e. "A". How can I do this?

Thanks.

Buttons Jump To Correct Frame, And Then Another Frame
I have buttons inside a movie clip. the actions assigned to these buttons affect the _root.

this is ok so far.

when i press a button, it jumps to the frame label it is supposed to. that frame label has a stop action on it.

another press of the same button, jumps to the next frame. this should not happen. i have only made one script and told it to go to one frame and one frame only.

does anyone know why a second and third presses will jump the timeline instead of keeping it where it is.

thanks

huggs

Go Back To Previous Stopped Frame?
Hey guyz I'm tryin to create a button that sort of "rewinds" but it doesn't have to show the rewind- all i want it to do is jump back to the previous frame with a stop action on it. So kind of like a "back" or "previous" button.

Any help- thanks. It's been a while since I have programmed a lot and I forget everything

Gettin Values From Previous Frame
Lets say i have a moving mc, and i want to compare it's _x value in the current frame to it's _x value in the previous frame, is there a way to do it?

Nextframe Previous Frame Problem?
hey...trying to get some text info running and i cant remember how to work the currentFrame func.

i have 2 buttons, 1 needs something along the lines of

gotoAndStop(currentframe +1) and the other currentframe -1. but i cant seem to get that working

anione got any clue?

thanks in advanced

[F8] Call A Boolean Value From A Previous Frame
Hey I think I'm being pretty dumb here but how can you call a Boolean value from a previous frame?

I have the trace code and the boolean is recording true or false just fine but I want to use this value in a frame a few seconds on. Does anyone know how to do this?

How(or Can You) Goto Next/previous Frame Label?
ive done some searching around and havent really found anything regarding going to the next/previous frame label. Is it possibe? if so how is it done?

Problem With Previous/next Frame Navigation
I have flash file that has buttons that point to different groups of movie clips. Each movie clip is contained within in a single frame. The user will click a button and go to one of the groups. Once a person is viewing a group of movies I want them to be able to arrow through them and be in an infinite loop until an exit button is clicked (e.g. hit the right button go to the next clip or hit the left button to go to the previous clip). When the code below appears for the first time on the time line it works flawlessly but if it appears a second time the play head does not loop when hitting the right or left arrow keys.

Here is the script I am currently using:


Code:

stop();

function keyDoSpider(event:KeyboardEvent):void
{
switch (event.keyCode) {
case Keyboard.LEFT :
prevFrame();
break;

case Keyboard.RIGHT :
nextFrame();
break;
}
}
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDoSpider);

Why GotoAndStop() Always Flash The Previous Frame?
Dear all, I found a strange thing like below:

ActionScript Code:
stop();
var mcAthlete:MovieClip = new Athlete();
addChild(mcAthlete);
addEventListener(Event.ENTER_FRAME, Loop);
Athlete.prototype.ChangeShoe = function()
{
    if(this.Shoe)
    {
        this.Shoe.gotoAndStop(2);
    }
}

function Loop(evt)
{
        mcAthlete.ChangeShoe();
}
the flash always show a flash with the "Shoe.Frame1", But I want to keep the Shoe always in frame2(Shoe.gotoAndStop(2). How I should do?

Unloading Previous Frame / Component
I'm loading in some pictures from the xml file with some script. And I wanted to unload it at the next few frames cause its lagging. How can I do that?

ActionScript Code:
import com.unic8.media.Scaena;

var mySlideShow:Scaena = new Scaena();
mySlideShow.load(this, "slide1.xml", "effects.xml");

Previous Frame/Label Condition
I have a function to disable & change the alpha of my prev/next buttons on my first/last frames of my slide show. The alpha has a tween and I want to use the tween going from slide 1 -> 2, 2->1, 13->14, 14->13. 1 -> 2, 2->1, it's the ending frames I'm having a problem with.

I need a condition, I think something like -- if ((currentFrame == 13) && (prevFrame == 14)). Except that doesn't work. I'm thinking there has to be a difference between frame 13's previous frame (which would always be 12) and the frame the playhead was just on.

I'm hoping that made sense. Does anyone have any suggestions how I would go about this?

A Back Button To Go To A Previous Frame
I've developped a Flash movie with 200 frames aprox (Flash MX 2004). We can go to whatever frame from whatever other frame. I have created a "back button" in every this 200 frames. The function of this "back button" is to come back to the frame previous that I was.

I have tried to solve with this code in every frame:

a) At the previous frame:
/:numframe = _root._currentframe

b) At the current frame (on the "back button"):
on (release){
gotoAndStop (numframe);}

That doesn't work. Could you help me, please ?. Thanks a lot

:( Cycling Code From Previous Frame?
oooh its still cycling the code from the previous frame when the current frame is ahead.... is there anything i can do to make it cycle only the code in its current frame?

Going To Previous Frame (not PrevFrame Fucntion)
Hello I am trying to develop a way to goto the previous frame that the user was on. Thiis is not the prevFrame script as I can only get that to go the exactly previous frame.

I need it ti fo the following:

If I have three frames and frames 1 and 2 have a button, which links to frame 3. If the user was to click a button after coming from frame one then it would retur them to frame one. I can only get it to return them to frame 2 even if they came from frame one. I also need to put the code in a function as it will be used by a lot of other movie clips which need to do the same thing. If its not clear what I am asking then please get back to me.

Is There A Way To Goto Next/previous Frame Label?
i know there is no function for it, but how could i do this?

After Clicking I Can Still See Parts Of The Previous Frame
Hello everyone,

I've set up my button to go back and play from the beginning. It does go back and plays correctly but it's not a smooth release of the button, meaning that I can see parts of the previous frame. I remember reading a similar post to this but can't seem to find it again. I'm sorry for this "double" post. But if anyone knows what I'm referring to, I'd really appreciate some help. Below is the AS for my button - it should go back and play frame 289 AND open up a new window for the link.

on (release) {
_parent._parent.gotoAndPlay(289);
_parent.vhost_mc._visible = false;
getURL("http://www.sjcd.edu/future_students_counseling.html", "_blank");
}

Thanks again

Unloading Previous Frame / Component
I'm loading in some pictures from the xml file with some script. And I wanted to unload it at the next few frames cause its lagging. How can I do that?
ActionScript Code:
import com.unic8.media.Scaena;

var mySlideShow:Scaena = new Scaena();
mySlideShow.load(this, "slide1.xml", "effects.xml");

AS3 - Unloading Previous Frame Functions
Last edited by youwh : 2008-09-01 at 19:59.
























I'm loading in some pictures from the xml file with some script. And I wanted to unload it at the next few frames cause its lagging. How can I do that?


ActionScript Code:
import com.unic8.media.Scaena;
 
var mySlideShow:Scaena = new Scaena();
mySlideShow.load(this, "slide1.xml", "effects.xml");

Making A Button Go To The Previous Frame On A Timeline
I have a movie where there is a moving series of buttons, these buttons are linked to an XML document and a frame at the end of the timeline which displays the relevant XML data.

I want to create a button on the final data display frame which will cause the movie to play again from where the user was previously on the timeline everything I try causes it to play again from frame 2 (I only want to play frame 1 once so as my XML data is not reloaded again)

Hope this makes sense!

Many thanks in advance,

Steve

Copyright © 2005-08 www.BigResource.com, All rights reserved