Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help with onClipEvent MX[04]

Status
Not open for further replies.

jbearclaw84

Technical User
Jun 6, 2007
20
US
I have a movie clip that acts like a button and inside the movie clip I have 2 frames. The code I have given the mc is:

onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.nextFrame();
} else {
this.prevFrame();
}
}

That all works fine. The problem comes when I try to add an animation inside this same movie clip (frames 3-20). Then place the code on (release) gotoandplay (3) to start the animation. This movie clip starts to flicker continuously between frames 1-2. I don’t understand why cause I have a stop on frame 2. It seemed after I added the xtra frames that the flickering started to occur. What am I doing wrong? Is there a better way to do this?
 
here is a code i have that works if i create the movieclip button on the main scene but do to my project the movieclip button is ebedded in 5 different movie clips (dont ask not my project just trying to work with what i got). the reason why i am not using a button is because i have a pan and zoom layer that obviously would disable any button. do you know how i could get this to work?

onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
if (this._currentframe == 1) {
this.gotoAndPlay(2);
}
} else if (this._currentframe == 2) {
this.prevFrame();
}
}
on (release) {
trace(this)
this.gotoAndPlay(3);
}
 
hey Kenneth,

inside the mc/btn i have a stop on frame 2 that makes my letters bold wich is a rollOver action and that works fine but now i have a short animation playing after frame 2 (frames 3-20) im trying to create a code that on Release gotoAndPlay's frame 3 but its not playing the animation for some reason
 
here are the different codes i have tried....

onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
if (this._currentframe == 1) {
this.nextFrame();
}
} else if (this._currentframe == 2) {
this.prevFrame();
} else {
// do nothing.
}
}

on (release) {
this.gotoAndPlay(3);
}
__________________________________________________________
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
if (this._currentframe == 1) {
this.nextFrame();
}
} else if (this._currentframe == 2) {
this.prevFrame();
}
}
on (release) {
this.gotoAndPlay(3);
}
______________________________________________________

onClipEvent (enterFrame) {
if (!clicked && this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.nextFrame();
} else {
this.prevFrame();
}
if (this._currentframe == this._totalframes) {
gotoAndStop(1);
clicked = false;
}
}
on(release) {
clicked = true;
gotoAndPlay(3);
}
And finally
_______________________________________________________

i switched to this...

onClipEvent(load) {
clicked = false;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top