Button to new scene, in movie clips?

Hi there,

I’ve been following a flash tutorial, It’s a complicated piece. You’ll have to look at it to see for yourselves.
My main problem is that I would like to try to add buttons to the scrolling ‘menu’ movie clips, that would enable me to go to a new scene. I’ve tried the ‘_parent.gotoAndPlay(2)’ etc, but due to my very basic knowledge of action-scripting I can’t get it to work.

Anyone have any suggestions, or wanna try?

Thanks.

This is in flash 5 but i’ll take MX scripting if I have to

You can’t change scenes from inside a movie clip.

You need to add the actions to a frame on the main timeline, then target that frame with your gotoAndPlay() action on your button.

Works the same in both 5 and MX.

Thanks for your help, Lost.

Lovely site by the way.

I read that you can’t change scenes from within a movie clip, but then I came across this:
http://raven.ubalt.edu/classes/old/pbds668.185_Sp02/gotoProblem.cfm

The guy on that page says its possible, and it would be cool if works, but no joy

Yeah, the method he used is what I said to do :slight_smile:

You need to do _parent.gotoAndPlay(frame#) on the button in the movie clip to a frame on your main timeline that contains the gotoAndPlay(“Scene”,frame#) AS.

ANd his other method involves variables, which you can try, and it does work :slight_smile:

Ohh, I see.

Thanks again, I’ll go and try that now.:slight_smile:

Good Luck :slight_smile:

Oh man, this just isn’t working.

This is what i get if i send it to frame 2:

Scene=Scene 1, Layer=Menu, Frame=1: Line 1: Statement must appear within on handler
_parent.gotoAndPlay(2)

I know i’m being cheeky, but do you think you could have a quick look at it to see where i’m going wrong? The red button on menu 1 should take me to frame 2 of the main timeline but i get the above message and a white screen

Hope you can help, thanks

Well even without looking at your .fla I can see the problem.

You put the code on the button… but you forgot the on handler

on (press) {
	_parent.gotoAndPlay(2);
}

Oh well done Lost.

I can’t thank you enough for your help, the mistakes probably look a bit silly to you, but i’m really not very good.

Regards

Dhero

Over time you will improve. Flash isn’t something you can pick up in a day, it is something you have to learn and get used to over time and practice :slight_smile:

Lost, i have come to the conclusion that you are one of the most helpfull people on this kirupa forum. Not the only person that helps, mind you, but the one that i see most frequently helping flashers. Props to you, dude!!