• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Go to previous frame

Explorer ,
Jan 30, 2019 Jan 30, 2019

Copy link to clipboard

Copied

Hi!

I am wondering if there is a way of pressing a button in a frame and go to previous frame played. I mean I can reach to that frame from deferents frames, and want to go back to the same frame I was before. Can you understand me?... or help?

Thank you very much.

Ana B

Views

1.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Advocate , Jan 30, 2019 Jan 30, 2019

Hi anab

it depends a little. Your desciptions sound like that all frames you navigate to are on one timeline. If that's the case then declare a variable in an Actions layer on frame 1:

var thePreviousFrame:int;

Now on every frame where you have a shortcut to your credits page (a button) with some actionscript like:

CREDITSBUTTON.addEventListener(MouseEvent.CLICK, CREDITSBUTTONHandler);

function CREDITSBUTTONHandler (e:MouseEvent) {

    thePreviousFrame = currentFrame;  

    gotoAndStop("credits");

}

On

...

Votes

Translate

Translate
LEGEND ,
Jan 30, 2019 Jan 30, 2019

Copy link to clipboard

Copied

  1. Do you mean inside ANCC timeline with a shortcut or you are talking about what you want to realize in code?
  2. ANCC AS3 or HTML5?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 30, 2019 Jan 30, 2019

Copy link to clipboard

Copied

Thank you for your answer resdesign.

No, I mean realize it with code, AS3.

I have frame with credits and almost all pages have a shortcut to the credits. I would like to go back to the same page, like a go to previous frame but previous frame played.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 30, 2019 Jan 30, 2019

Copy link to clipboard

Copied

I do not code AS3 but I would assume you could use a variable to know where you are and go where you want.

For example.

var current;

then you could set the variable to where you are, for example on page 1 set currrent to 1, on page 2 set current to 2, and so on.

//for page 1

current = 1;

Now on your credit page, check the value of the variable.

if (current == 1){

  // go to page that has current = 1;

      this.gotoAndPlay("page1");

}

and so on.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 30, 2019 Jan 30, 2019

Copy link to clipboard

Copied

Thank you, I will try that...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 30, 2019 Jan 30, 2019

Copy link to clipboard

Copied

You could also make it more general

I would have an array of the name of the different locations. Then I would have something like this:

var pages = ["home", "about", "bio"];

this.gotoAndStop(pages[current]);

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jan 30, 2019 Jan 30, 2019

Copy link to clipboard

Copied

And your credits page needs a label called "credits".

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 04, 2019 Feb 04, 2019

Copy link to clipboard

Copied

LATEST

Thank you!

I manage to do it with your suggestion

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jan 30, 2019 Jan 30, 2019

Copy link to clipboard

Copied

Hi anab

it depends a little. Your desciptions sound like that all frames you navigate to are on one timeline. If that's the case then declare a variable in an Actions layer on frame 1:

var thePreviousFrame:int;

Now on every frame where you have a shortcut to your credits page (a button) with some actionscript like:

CREDITSBUTTON.addEventListener(MouseEvent.CLICK, CREDITSBUTTONHandler);

function CREDITSBUTTONHandler (e:MouseEvent) {

    thePreviousFrame = currentFrame;  

    gotoAndStop("credits");

}

On your credits page for the interactive element (button) to go back to previous page:

PREVIOUSBUTTON.addEventListener(MouseEvent.CLICK, PREVIOUSBUTTONHandler);

function PREVIOUSBUTTONHandler (e:MouseEvent) {

     gotoAndStop(thePreviousFrame);

}

(CREDITSBUTTON and PREVIOUSBUTTON are of course just placeholders for your instance names of those particular interactive elements.)

Klaus

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines