Copy link to clipboard
Copied
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
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');
Copy link to clipboard
Copied
don't use scenes for navigation with as2.
label your frames and use frame labels to navigate.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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');
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
if you see no compiler errors, you probably have an onEnterFrame or setInterval loop in your code causing the problem.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now