I did a movie clip, when mouseover and when mousedown thing. And i put it onto main stage. It didn’t work. So i converted that movie clip to a button so it became a movie clip in a button. When i go on, it plays, when i press, it plays, but it doesnt go to second frame when i press it. How can i?
I would start again, you seem to be in a big mess here.
To make a movieclip as a button:
-
Make a graphic for the button, and convert it into a movieclip
-
go into the movieclip and put a stop() action on the first frame
-
still in this clip make a second keyframe and put a stop() on this too. Now edit this graphic for the ‘roll over’ state you want
-
Go back to the main stage and select the button clip, and put this code on it:
on (rollOver) {
gotoAndPlay(2);
}
on (rollOut) {
gotoAndPlay(1);
}
on (press) {
//enter what you want the button to do when it is
//pressed in here
}
That should work, ok
it doesnt work
can you do and send me a simple fla?
help!
Post what you have so far so we can see what you’ve done wrong.
Sorry I can’t do it I haven’t got flash on this PC.
But what isn’t happening? Is the rollover animation working?
post your fla file
TD
ok
First i created a movie clip. On the first frame of movie clip, i put stop, drew a square, black, on the second frame, i colored that black square to the red. On the first frame, i converted square to the movie clip, put
on (rollOver) {
gotoAndStop(2);
}
,on the next frame, i converted red square to a movie clip and put
on (rollOut) {
gotoAndStop(1);
}
then i went on to main stage. I put the first frame stop, i put the movie clip to the stage, and in the actions, i put
on (release) {
gotoAndStop(2);
}
i screwed sth to the second frame.
All i want is when the mouse is over the black square, it must turn red, and if i press it, it must go to second frame of the main stage.
here it is, i did what i told you in the last message
see if this is what you want:
Ok, you missed the stop() that you need to have on frame 2 INSIDE the button.
Also any rollover, rollout, press, release, etc. events go ON the movieclip instance, NOT inside the movieclip itself.
So now it works, if you wanted to animate this, just change the gotoandstop to gotoandplay, and do whatever animation you want. making sure that the rollout goes to the correct frame of the beginning of the rollout animation.
Makes sense?
hamidb4, actually what i wanted was not a button, but making movie clip a button.
beanboy, it didnt work, again, when i click the button, it doesnt go to 2nd frame.
actions for black box movie clip:
frame 1 of movie clip: stop();
frame 2 of movie clip: stop();
actions to put on the clip on the main stage:
on (rollOver) {
gotoAndStop(2);
}
on (rollOut) {
gotoAndStop(1);
}
on (release) {
_parent.gotoAndStop(2);
}
That’s it. When you roll onto the movie clip it shows frame 2 [red square], when you roll off it shows frame 1 [black square] and when you click it it goes to frame 2 of the scene.
Yeeha, thanks very much