A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: AS 2 - Next Frame continuous question

  1. #1
    DC Man
    Join Date
    May 2007
    Posts
    16

    AS 2 - Next Frame continuous question

    Simple thing here but I can't figure it out, and it's in actionscript 2.0.

    emptyMC is a movie clip that includes frames of a 3D thing that I want to make turn when the user clicks the button. I want it to turn 9 frames from wherever in the movie clip it is. I thought that if I just make it go to the next frame, along with adding a value to x every time (xx+1) that it would go frame by frame along until it gets to frame 9.

    Instead, it just jumps right to the last frame when you click on it. Thanks in advance for any help. Here is the code:


    on (release) {

    var x = emptyMC._currentframe;

    while (x < 10){
    emptyMC.nextFrame();
    trace (x);

    x++;

    }
    }

  2. #2
    http://pat.theorigin.net cresquin's Avatar
    Join Date
    Jun 2003
    Location
    Los Angeles, CA
    Posts
    685
    it is jumping to the end because it you are sending the nextFrame() command 10 times at once. Instead you need to trigger an onEnterFrame function that runs for 9 frames and kills itself.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center