Highlighted

Go to previous frame

Explorer ,
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

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

Views

341

Likes

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

Go to previous frame

Explorer ,
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

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

Views

342

Likes

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
Jan 30, 2019 0
Adobe Community Professional ,
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?

Likes

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
Reply
Loading...
Jan 30, 2019 0
Explorer ,
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.

Likes

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
Reply
Loading...
Jan 30, 2019 0
Adobe Community Professional ,
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.

Likes

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
Reply
Loading...
Jan 30, 2019 1
Explorer ,
Jan 30, 2019

Copy link to clipboard

Copied

Thank you, I will try that...

Likes

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
Reply
Loading...
Jan 30, 2019 0
Adobe Community Professional ,
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]);

Likes

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
Reply
Loading...
Jan 30, 2019 1
Advocate ,
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

Likes

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
Reply
Loading...
Jan 30, 2019 1
Advocate ,
Jan 30, 2019

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
Jan 30, 2019 1
ATGB LATEST
Explorer ,
Feb 04, 2019

Copy link to clipboard

Copied

Thank you!

I manage to do it with your suggestion

Likes

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
Reply
Loading...
Feb 04, 2019 0