Advertisement

03.25.2008 at 09:47AM PDT, ID: 23267662 | Points: 50
[x]
Attachment Details

if totalFrame then gotoandStop - nextFrame

Asked by spark067 in Macromedia Flash

Tags: , ,

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.totalFrames);
      }
      else
      {
            prevFrame();
      }
}

I am attaching FLA file so please change .txt to .zip.
Thanks,
Start Free Trial
Attachments:
 
Please change .txt to .zip
 
[+][-]03.26.2008 at 03:59AM PDT, ID: 21210292

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.26.2008 at 02:55PM PDT, ID: 21216754

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628