Quick help!

I have a button inside of a movieclip… AND I CAN’T RMEMEBER HOW TO MAKE IT GO.

so simple a thing, and i can’t get past it…

it’s just a button in a movieclip… i’m not asking too much… and i need it to point to and play a different scene… and i already tried the stupid _root. thingie…

and it’s so simple…
i’m going to go cry now…

help.

sniff

Valmont

What is the code on the button?

What frame and scene do you need to gotoAndPlay?

button code:


on (release) {
gotoAndPlay ("_root.main", 6);
}


All i really need it to do is play frame 6 in the same scene that the mc is in. main is the scene that is going to contain most of the movie as this is just a temporary site. The only reason that the button has to be inside of an mc, is because the button has to be part of a moving whole, but this moving whole can’t be a button…
either way i need a button in an mc that can point to a frame of the scene the mc is in.

thanks

Valmont

have you tried using a frame label instead of number? Try that out and see if it helps at all.

also, you’re calling to the root to go somewhere, so it belongs at the head of the oop string, like so.

on (release) {
_root.gotoAndPlay (“main”, 6);
}

that on it’s own might fix the problem… I’m not sure.

yeah, i did try the frame label, and it didn’t work, so i’ll try putting the root up front of the string. Let you know how it goes
thanks
valmont

yeah… putting the root before the string did nothing… any other ideas?

nope, but you’re welcome to send me the FLA to debug. If you do, just be sure to include enough instructions related to what the problem is. I get a lot of emails requesting help in a day.

my email is [email protected]

As a quick thought, you have named all the movie clips etc right?

Took me ages to catch a dumb typo last time. :slight_smile:

yeah… troubleshooting techniques, for me, always start with checking instance names verses calls to those names. Instance names often disapear after you think you’ve set them so it’s a good practice to get into.

You can also use the Movie Explorer to tell you path names to objects contained in your movie. Useful for figuring out those pesky call operations.

Second thing I always check when debuging to that I have a semi-colon at the end of each appropriate line. I’m always leaving those out and screwing something up. Sometimes it’s ok… flash wont care, other times it just makes things buggy.

Yay!! Found out what i’m working on wasn’t needed for the project… but even so… if you need a button inside an MC… (say you have a button that follows the X axis of a mouse, but is part of a bigger picture…) then what the hell should you do?
we should get this one down for future use so that the simple folk can learn from us wise Tai Bo Masters.
Valmont

There isn’t anything to solve. The code works fine for me 100% of the time. You had to have an error in the project somewhere.

hmmmm…

that is all

:slight_smile:
(thanks)
Valmont

I did run into a similar problem with another fellow in a recent thread. He opted to leave out the scene name, and it worked fine… though he was using frame names. So the solution might be

on (release) {
_root.gotoAndPlay (,6);
}

or you might have to give the frame a name and call it like this

on (release) {
_root.gotoAndPlay (“theNameOfTheFrame”);
}

you could try both of those out in your code, just to see if it solves the problem. I appears that Flash doesn’t like the scene names when being called from inside another movie clip. I don’t know why that would be, and I haven’t had time to experiement with it so I’m still not 100% that this is the solution… but it worked for the other gentleman.

I should not have said that that code works for me 100% of the time, because I never use multiple scenes to divide up my movie, so I never use scene names in my action methods.

I’ve had problems in the past with both Scene names and frame labels, and in the end I’ve had to go for the awkward way and just use the frame numbers.