Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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..
Copy link to clipboard
Copied
Maybe easier to figure out a variable change event for the username/password check (online DB). As to the help item, can keep it on the first frame, hide/show as needed.
Thank you for your suggestions.
Copy link to clipboard
Copied
you're welcome.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now