Buttons inside a Movie Clip

Hello everyone!

I have the following problem:
I have created a sliding menu consisting of a Movie Clip using AS for the slide effect, in which I have placed the navigational buttons. I want the menu to change the Scene (eg. from Scene 1 to Scene 2) when someone presses the button, my problem is that nothing is happening. Please find the code I used below:

Code used for the Movie Clip:

onClipEvent (enterFrame) {
if (yvel == 1) {
_y = _y+(445-_y)/6;
}
if (yvel == 0) {
_y = _y+(550-_y)/10;
}
}

Code used for the Buttons:

on (rollOver) {
yvel = 1;
}
on (rollOut) {
yvel = 0;
}
on (release) {
gotoAndPlay(“Scene 2”, 1);
}

I hope that my explanation was clear and understandable enough for someone to help me solve this (probably minor) problem.

Thanx in advance and greetings to all you flashers out there! (-:

I think the mistake lies in the gotoAndPlay Statement:

it’s better to create a frame label e.g. name the first frame of scene2 “myScene”

and then add this code to your button:

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

Thank you for your help! :thumb:

Your suggestion worked just fine!

Thx again, Mike.

i have a similar problem. is it possible to click a movie symbol and have it jump to another movie? it should!

i have a fish (named “dunce”) on the stage that floats around. in fact, it floats around according to the random movement code provided by this site. now… when the user clicks the fish, i want the fish to exploded (:skull: :)). i have a movie named “splat”, and it’s first frame is labeled “thesplat”. whats wrong with my coding here:
onClipEvent(enterFrame){
move();
}
onClipEvent (mouseDown) {
_root.gotoAndPlay(thesplat)
}

thanks in advance

Flash is looking for a frame called “thesplat” on the _root level (main timeline). You need to target the movieclip that contains the frame label.


onClipEvent(enterFrame){
move();
}
onClipEvent (mouseDown) {
_root.splat.gotoAndPlay(thesplat)
}

Untested but should work.

:hr:

nope :(… same thing. no exploding fish. nothing comes up in the output box either, it’s weird. i attached the fla, it’s pretty messed up though, i don’t even know how to delete those extra symbols. flash is currently my largest area of n00bness.

Your mc “splat” wasn’t on stage;)
I’ve putted it in your “dunce” mc [size=1](with a stop() on the first frame of “splat” and the instancename “splat”)[/size]
then with this code

onClipEvent(enterFrame){
	move();
}
onClipEvent (mouseDown) {
	splat.gotoAndPlay("thesplat")
}

your fish explodes=)

scotty(-:

omg i love you! thank you thank you thank you. this forum is teh pawsorz!!!11

ok… i didn’t think about this. you don’t actually have to click the fish for it to blow up. you can click anywhere and it goes splat, which is rather pointless. there’s gotta be a way so when people just click the fish that’s floatin round, then it goes splat.

anyone?

Just change where the function gets called from a mousedown clip event to an onPress of the clip itself. The function used to be on the movie clip itself and now it is on the maintimeline.

“I see” said the blind man pissing into the wind, “it’s all comming back to me!”.

sank ya barry moots. this isn’t really about the subect of this thread anymore, but how can i make the cursor into a little cross hair over the fish? i’ll go have a gander at the tutorials…

http://www.kirupa.com/developer/flash5/globalmousecursor.htm
http://www.kirupa.com/developer/flash5/follow.htm
will give you an idea:)

scotty(-: