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

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

Contributor ,
Jul 25, 2013 Jul 25, 2013

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.

TOPICS
ActionScript
903
Translate
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
Community Expert ,
Jul 25, 2013 Jul 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.

Translate
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
Contributor ,
Jul 25, 2013 Jul 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

Translate
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
Community Expert ,
Jul 25, 2013 Jul 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..

Translate
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
Contributor ,
Jul 25, 2013 Jul 25, 2013

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.

Translate
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
Community Expert ,
Jul 25, 2013 Jul 25, 2013
LATEST

you're welcome.

Translate
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