is it possible tpo have a movie clip use the gotoAndPlay function without converting it to a button.

Recommended Answers

All 3 Replies

its very possible in fact movieclips are used more often as buttons than the actual button symbols them selves. this is because movieclips have a variety of functions that buttons dont.

coming to your question. a movieclip can have its own time line and therefore the gotoAndPlay event can be triggered with or within a movieclip

i have set my timeline inside the movie clip up so that i have my frame labels for the up, over and out states. the problem i am having is that when the mouse moves over the movie clip it is not playing the animation.

i have set the script up on the main timeline so that the animation should play but it is not. the code i have used on the main timeline looks like this

this.prof_mc.onRollOver = function() {
	prof_mc.gotoAndPlay("over");
};
this.prof_mc.onRollOut = function() {
	prof_mc.gotoAndPlay("out");
};

i have put a on release function on the movie clip on the main stage and this is not working. when the movie clip is pressed once it is playing the over state from inside the movie clip and when it is pressed again it plays the out state of the movie clip which should not be happening.

the on release on the movie clips has been scripted like this

on (release){
	gotoAndPlay("_about");
}

i have set up the timeline with frame labels for the individual pages with "_about" being one of the pages i have set up.

if someone could tell me where i have gone wrong that would be great as i have not a clue why it is behaving in this way.

i worked this out a few days ago forgot to come back and post my answer. to get the gotoAndPlay to work how i wanted it to i had to tell the playhead which level i wanted it to gotoAndPlay on, the code which worked for me is as follows

on (release) {
	_level0.gotoAndPlay("_about");
}
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.