Skip to main content
saratogacoach
Inspiring
July 25, 2013
Question

ActionScript Only Project: can more than Frame 1 be accessed?

  • July 25, 2013
  • 1 reply
  • 987 views

I haven't been working in AS-only, where a Main.AS has all of the script. Usually have timeline, multiple frames, with gotoAndPlay(), etc.

Can an AS based project where all scripting is in the AS3 script file use gotoAndPlay and access a second or third frame, etc.? If yes, how is this scripted?

Thank you for your help.

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
July 25, 2013

if Main.as is your document class (and it extends the MovieClip class), you can use goto methods in the document class just like you would on the main timeline.

if you want certain code to execute after a goto, use stage.invalidate() and the render event.

saratogacoach
Inspiring
July 25, 2013

Hi kglad,

Thank you for this reply and suggestions. So, if in the Main actionscript, I would like to add a button, event listener and gotoAndStop(2) (there are no frames or visible timeline), this would be OK. I was thinking of putting some help/how to use content on a second frame (for those who need it).

Dynamically creating the nav button is easy, but can it navigate to a second frame where I would dynamically create some text box with content?

I'll look up stage.invalidate, render event, since I'm not familiar with these.

saratogacoach

kglad
Community Expert
Community Expert
July 25, 2013

it doesn't make any sense to use gotoAndStop(2) if there's no frame 2 on the timeline that's being directred to its 2nd frame.

if the frame exists, you can use a gotoAndStop(2) and you can add any number of objects to that frame using actionscript and you can reference those actionscript-created objects, as well as, any object that already exists on that frame because it was created in the flash ide..