00:00
00:00
Newgrounds Background Image Theme

Someone gifted MetalSlayer69 supporter status!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

AS2 Frame Navigation

535 Views | 3 Replies
New Topic Respond to this Topic

AS2 Frame Navigation 2023-03-27 16:09:39


I am in progress making a "comic" that is made with Flash and ActionScript2. The problem that I am having is frame navigation. The picture below is the title screen that leads viewers to the next "panel". This is where the trouble begins. I have the preloader set up (thanks to an old tutorial), but I don't know how to get the comic navigating. How do I do this, and may I request help through this post? Thank you.iu_932841_12827068.webp

Response to AS2 Frame Navigation 2023-03-28 12:55:09


You can create buttons to go to the next frame, previous frame, jump to a different frame and more. There's a "snippets" panel that handles all of the basics for you in Flash (check the Tools/Panels menu), but if it's not available, then here's some code to get you started.


Create a button, select it and press F9 to open up the Actions panel; then, enter the following code depending on the situation:


To go to the next frame:

on(release) {
  _root.nextFrame()
}


to go to the previous frame:

on(release) {
  _root.prevFrame()
}


to go to a specific frame (e.g. frame 10) and stop:

on(release) {
  _root.gotoAndStop(10)
}


to go to a specific frame (e.g. 10) and play:

on(release) {
  _root.gotoAndPlay(10)
}


I haven't tested the first 2 so I'm not sure of their exact syntax, but I believe it should be correct based on what I remember.


Slint approves of me! | "This is Newgrounds.com, not Disney.com" - WadeFulp

"Sit look rub panda" - Alan Davies

BBS Signature

Response to AS2 Frame Navigation 2023-03-29 10:02:59


At 3/28/23 12:55 PM, Gimmick wrote: You can create buttons to go to the next frame, previous frame, jump to a different frame and more. There's a "snippets" panel that handles all of the basics for you in Flash (check the Tools/Panels menu), but if it's not available, then here's some code to get you started.

Create a button, select it and press F9 to open up the Actions panel; then, enter the following code depending on the situation:

To go to the next frame:

to go to the previous frame:

to go to a specific frame (e.g. frame 10) and stop:

to go to a specific frame (e.g. 10) and play:

I haven't tested the first 2 so I'm not sure of their exact syntax, but I believe it should be correct based on what I remember.

Thank you very much! I will try the code out to see if it works. If it does (which I think it should), I will let you know. Thank you again!

Response to AS2 Frame Navigation 2023-03-29 10:11:10


At 3/28/23 12:55 PM, Gimmick wrote: You can create buttons to go to the next frame, previous frame, jump to a different frame and more. There's a "snippets" panel that handles all of the basics for you in Flash (check the Tools/Panels menu), but if it's not available, then here's some code to get you started.

Create a button, select it and press F9 to open up the Actions panel; then, enter the following code depending on the situation:

To go to the next frame:

to go to the previous frame:

to go to a specific frame (e.g. frame 10) and stop:

to go to a specific frame (e.g. 10) and play:

I haven't tested the first 2 so I'm not sure of their exact syntax, but I believe it should be correct based on what I remember.


I tested the code, and it does work as intended! Once again, thank you.