Hi everyone,
I still can't figure out my problem.
I have a movieClip called :mc_fact" and there are about 20 facts on the movieClip(mc_fact).
Frame7
I put this because this is the first fact and no prev_btn on this frame.
After this frame I put both buttons(prev_btn and next_btn)
Frame26 is the last fact so if user clicks the next_btn, then it will go to the first frame which frame7.
Here I put my AS 3 on the frame7 and 8.
FRAME7
stop();
next_btn.addEventListener(
MouseEvent
.CLICK, goForward);
function goBack(event:MouseEvent) {
nextFrame();
}
function backward(event:MouseEvent)
{
prevFrame();
}
--------------------------
----------
----------
----------
----------
----------
----------
----------
----------
----------
----
Frame8
stop();
prev_btn.addEventListener(
MouseEvent
.CLICK, goForward);
next_btn.addEventListener(
MouseEvent
.CLICK, goForward);
function goBack(event:MouseEvent) {
if (this.currentFrame == this.totalFrames)
{
gotoAndStop(7);
}
else
{
nextFrame();
}
}
function backward(event:MouseEvent)
{
if (this.currentFrame == 1)
{
gotoAndStop(this.totalFram
es);
}
else
{
prevFrame();
}
}
I am attaching FLA file so please change .txt to .zip.
Thanks,
Start Free Trial