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

Can’t get my dropdown menu buttons to link to another scene.

New Here ,
Feb 01, 2015 Feb 01, 2015

I can’t get my dropdown menu buttons to link to other scenes within the same Flash file.  The buttons are unresponsive during playback – as if no code were attached to it.  Here’s what I have as my AS2 code on the dropped button that is supposed to link to the "Published" scene/page:

on(release){

_root.gotoAndPlay("published", 1);

}

I'm working with Actionscript 2.0 in Flash CS6.

Any help would be appreciated!

Thanks,

Robert

TOPICS
ActionScript
666
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

correct answers 1 Correct answer

Community Expert , Feb 01, 2015 Feb 01, 2015

you can use different scenes.

but don't use scene info for navigation (in your actionscript).

eg, if you want to use a goto to the 18th frame of scene 5, label that frame (eg, 'frame18_scene5') and use:

_root.gotoAndPlay('frame18_scene5');

Translate
Community Expert ,
Feb 01, 2015 Feb 01, 2015

don't use scenes for navigation with as2.

label your frames and use frame labels to navigate.

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
New Here ,
Feb 01, 2015 Feb 01, 2015

 

Thanks for the suggestion, kglad.

I could place the entire site in one scene and simply program the buttons with

On(release){gotoAndPlay(Frame#);}

The biggest problem with that is each scene is distinctly different; different layers, graphics, etc.  Placing everything in one scene would create a mess and a number of discrepancies. There must be a way to link to different scenes.  Correct? Non-dropdown buttons have no issue with linking to other scenes; it seems odd that a dropdown button would.

 

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 ,
Feb 01, 2015 Feb 01, 2015

you can use different scenes.

but don't use scene info for navigation (in your actionscript).

eg, if you want to use a goto to the 18th frame of scene 5, label that frame (eg, 'frame18_scene5') and use:

_root.gotoAndPlay('frame18_scene5');

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
New Here ,
Feb 02, 2015 Feb 02, 2015

 

Thanks for the clarification, kglab; the frame labeling link did work!

The problem I have now, though, is that Flash refuses to remain on the newly linked-to scenes before skipping to the last scene – which in turn skips to the first scene where it remains.

I’ve tried applying the gotoAndStop functions to the button script as well as placing the stop(); function in the first frame of each scene, but nothing seems to keep the program from skipping through the scenes.

 

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 ,
Feb 02, 2015 Feb 02, 2015

if you see no compiler errors, you probably have an onEnterFrame or setInterval loop in your code causing the problem.

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
New Here ,
Feb 02, 2015 Feb 02, 2015

 

Hi kglab,

 

I do get these compile errors:

Scene=published, layer=Buttons, frame=1, Line 1 Statement must appear within on handler

Scene=published, layer=Buttons, frame=1, Line 2 Statement must appear within on handler

 

But, I think you are correct about the setInterval Loop.  On the home scene I’ve created a movie symbol which is set to call another swf file:

loadMovie("frontSlideshow.swf", _root.movie1);

 

This frontSlideshow.swf file has the following code in every 10 frames:

this.stop();

pause = function ()

{

               play();

clearInterval(pausei);

}

pausei = setInterval(pause, 5000);

 

This will pause the timeframe every 5 seconds before sliding to the next frame so that each image can be viewed.  It seems odd that the code from this subclass file would affect the timeframe of the main class/file where the “movie1” symbol is located.

 

Best,

Rob

 

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 ,
Feb 03, 2015 Feb 03, 2015
LATEST

first, fix those errors by clicking your frame 1 buttons and looking for stray code in the actions panel.  delete it.

if you still see a problem after doing that comment out that loadMovie function and retest.

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