mc button code
- Started
- Last post
- 1 Response
- Buckyball2
Having trouble. Roll in/roll out work fine. Plays the mc forward on in and plays the mc backward on roll out. but the release function isn't working. I want it to go to a particular frame on my timeline. Just sits there. Anyone see any obvious problems? Will an mc act like a button if coded like this?
code:
on (rollOver, dragOver) {
this.onEnterFrame = function() {
if (this._currentframe != this._totalframes) {
this.nextFrame();
} else {
delete this.onEnterFrame;
}
};
}
on (releaseOutside, rollOut, dragOut) {
this.onEnterFrame = function() {
if (this._currentframe != 1) {
this.prevFrame();
} else {
delete this.onEnterFrame;
}
};
}
on (release) {
gotoAndPlay(100);
}thanks
- davi-t0
add instance name to mc. code the event a bit diff.
instanceName.onRollOver=function... //-->insert ur code;};
instanceName.onRollOut=function... //-->insert ur code;};
instanceName.onRelease=function... //-->insert ur code;};