i have a problem with flash 8......i made a movie clip and i made a button in it...i want to make this button GoToAndPlay a keyframe in the Scene that contains this movie clip...everytime i make this the button moves in the movie clip and not the scene....what can i do????

Dani AI

Generated

described a classic scope issue: a button that sits inside a MovieClip will run timeline actions in that clip's scope, so a plain gotoAndPlay() changes the movie clip timeline rather than the main scene. As asked for code, here are concise ActionScript 2 approaches that work in Flash 8.

Place this on the button (inside the clip) to target the main timeline by name (prefer a frame label rather than a hard frame number):

on(release) {
  _root.gotoAndPlay("mainLabel");
}

A cleaner pattern is to assign the handler from the parent/root timeline so the button code does not live inside the symbol:

_root.container_mc.myButton.onRelease = function() {
  _root.gotoAndPlay("mainLabel");
};

Notes and cautions: use a frame label (mainLabel) on the main timeline to avoid fragile numeric frames. _root is fine for single-SWF projects, but if the SWF is loaded into another SWF it can point to the loader root and break encapsulation; in that case expose a controller function on the parent or use a message/event pattern instead of _root. For maintainability, avoid putting navigation logic on symbol timelines—assign handlers from the timeline that owns the navigation or use instance names and a central controller.

Recommended Answers

All 2 Replies

Member Avatar for Member #46692

i have a problem with flash 8......i made a movie clip and i made a button in it...i want to make this button GoToAndPlay a keyframe in the Scene that contains this movie clip...everytime i make this the button moves in the movie clip and not the scene....what can i do????

Do you have the actionscript code?

I want the code.......What is the Code To make it.......

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.