PDA

View Full Version : movieclip control


newjack
07-31-2006, 10:21 PM
I have a rollover actionscript for a button below.

on (rollOver) {
//Movieclip GotoAndPlay Behavior
this.spinround.gotoAndPlay("2");
//End Behavior


}

Is it possible instead of having the frame number of the movie clip, (in this case "2") to tell the movie clip to go forward and stop after a particular number of frames?

For example say I have a movieclip of 100 frames I tell the button on rollover to play and advance the movieclip 10 frames at a time.

So rollover once you get frames 1-10.. rollover again and you get frames 11-20... and so on....

Thanks ever so much if you can help

BernzSed
08-01-2006, 01:17 AM
So, if I understand you correctly, you want to be able to get the movieclip to play when the button is rolled over, but then stop every 10 frames.


So, attach this code to your button:on (rollOver) {
//Movieclip GotoAndPlay Behavior
this.spinround.play();
//End Behavior
}
And, on the first frame of the spinaround movieclip, place this code:stop();
this.onEnterFrame=function(){
if(this._currentframe%10==0){
stop();
}
}

Hope that helps!

newjack
08-01-2006, 11:19 AM
That's perfect! You've made me very happy thanks.

BernzSed
08-01-2006, 10:08 PM
Glad to help!