Skip to main content
September 6, 2006
Answered

_root.gotoAndPlay inside a movie clip doesn't work with multiple scenes

  • September 6, 2006
  • 3 replies
  • 424 views
Hello
My site was up and running when I decided to add a preloader, which I placed in a new scene before the real site.
Now I notice that all my buttons are broken.
After some research I found out that a button with _root.gotoAndStop(5) inside a movieclip (and there are a lot of them in my site) doesn't work anymore since there are multiple scenes.
Is this a bug or is there a workaround? (I'm using Flash MX 2004)

This file may illustrate the problem.
download example
Thank you
This topic has been closed for replies.
Correct answer Craig Grummitt
it's not a bug - it's avoidable by doing two things:

not using _root

referencing frames through use of labels(regardless of the scene they're in!)

3 replies

Inspiring
September 7, 2006
Oh, PS for 5chen, it reminds me of that old joke.

Doctor: Does it hurt when you do this?

Patient: Yes doctor.

Doctor: Well then stop doing that!

It may be infuriating and annoying, but in the end it is the way it is. And personally I find the "work around" to be better than the "more naive" approach. Suck it up and in the end you will be glad. Really!
Inspiring
September 7, 2006
Not really a bug, but just (IMHO) a bit of sloppy design on the part of the Flash creators.

Scenes were a great way of organizing authortime created timeline animations. During publishing Flash just strings all the scenes end to end creating one long timeline.

The problem really comes in when you start combining Actionscript control of the playhead with scenes. And the advice Craig Grummitt is great, but to my mind doesn't go far enough. If you are planning on using AS then I recommend not using scenes at all. With careful design you can use individual movieclips instead of scenes to organize what might otherwise be unwieldy timelines.

Besides the MovieClip is sort of the central paradigm upon which Flash/ActionScript is based – so to my mind it is a better way to organize file. There are so many methods, properties, and events for the MovieClip class so it really gives you control. In the end scenes don't even exist in your file, so what kind of control will you have then? (Of course maybe I need to work on my control issues, but that is for another forum!)
Craig Grummitt
Craig GrummittCorrect answer
Inspiring
September 6, 2006
it's not a bug - it's avoidable by doing two things:

not using _root

referencing frames through use of labels(regardless of the scene they're in!)
September 6, 2006
thanks
but if it's not a bug, what's the reason for them to make it so difficult?
September 7, 2006
I have the same question, I find this most infuriating.