Where to put the code?

Newbie question:
Have been reading posts and have two questions:

  1. When working with buttons, the AS for that button is placed on the keyframe holding the button instance? The code is NOT placed on the button states, right? Or not?

  2. Have a button at the end of a MC that is supposed to link to a new scene (“scene 2”), , frame 1 but every time I click it, it replays the MC. Can’t solve!

Used this code to no avail:

chile.onPress = function() {
gotoAndPlay(“Scene 2”, 1);
};

chile = button instance name

Thanks much, JC

  1. When working with buttons, the AS for that button is placed on the keyframe holding the button instance? The code is NOT placed on the button states, right? Or not?

No. Right click on the button in the scene and select Actions.

  1. Have a button at the end of a MC that is supposed to link to a new scene (“scene 2”), , frame 1 but every time I click it, it replays the MC. Can’t solve!

the code referred to as NextScene() will go to the next scene and stop. It does NOT go to the next scene and play. I’m not sure if that is your issue or not, but hard to tell without looking at code or file.

on your chile button function, you have to tell it which movie to go and play. if it is _root.gotoandplay or mymovie.gotoandplay…

otherwise, you’re dealing with defaults, and you just cant count on those all the time.

thanks a lot.
I played around some more and decided, for now, to forego the scene idea.

I added the MC I want to jump to on a frame in the main timeline and put this code (below) in the MC I’m jumping from on the frame holding my button - works fine … is this the same as you suggested?

chile.onPress = function() {
_root.gotoAndStop(6);
};

I picked up the _root from a convo you and VixenLady had awhile back, so thanks there too.

JC

:slight_smile: Im glad you like it!