A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: nextFrame();

  1. #1

    nextFrame();

    OK, Fk says my last login was 3/23/2006! So I'm rather rusty!

    All I wanted for now is to drag an image and update the view on release. So, I have two frames:

    1) Layer 1 : Frame 1
    stop();

    2) France_draggable (a movie clip)
    on (press) {
    startDrag(this, false);
    }
    on(release) {
    stopDrag();
    start.gotoAndPlay(2);
    nextFrame();
    nextFrame();
    }


    and...
    3) Layer 1 : Frame 2
    stop();

    When I play, it starts and stops dragging nicely. But it will not advance the frame. If I try something else like getUrl, that works fine too. gotoandPlay does nothing as well, though.

    What am I missing?

    This is Flash MX2004, as2.
    Help me help kids and people learn: openhistoryproject.org

  2. #2
    Senior Member
    Join Date
    May 2002
    Posts
    1,017
    looks like a scope issue. What timeline are you trying to advance? If it is the main one you need to use _root.nextFrame(); Also where is this movieclip start? Is it within the France_draggable movieclip? And why are you calling nextFrame twice?
    while (2+2 == 4) {
    drink ("bourbon");
    }
    gotoAndStop("bed");

  3. #3
    Great, thanks. Figured it was scope, but none of the tutes was clear enough.

    Two questions:
    -Should france_draggable perhaps have been a button?
    - What else should I know about scope--other than _root?
    Help me help kids and people learn: openhistoryproject.org

  4. #4
    Senior Member
    Join Date
    May 2002
    Posts
    1,017
    Quote Originally Posted by ej0c View Post
    Great, thanks. Figured it was scope, but none of the tutes was clear enough.

    Two questions:
    -Should france_draggable perhaps have been a button?
    - What else should I know about scope--other than _root?
    If it's a button or a movieClip depends on what functionality do you want to implement.

    Every movieclip has it's own timeline. In AS2 the main timeline is the _root. You can access each timeline (movieclip) of nested movieclips with the dot syntax. For example if you have on the main timeline a MovieClip instance called "circle" and within it another movieclip called "square". To make square go to the secondframe you need to use _root.circle.square.gotoAndStop(2); Or if you are attaching the code to the circle movieclip then you can use square.gotoAndStop(2)
    Generally it's a good practise to have all your code on the first frame of main timeline.

    Here is a good article on scope:
    http://www.adobe.com/devnet/flash/ar...ctices_04.html
    while (2+2 == 4) {
    drink ("bourbon");
    }
    gotoAndStop("bed");

  5. #5
    Thanks!! I read a bunch of "basic" tutorials that just glossed over that.
    Help me help kids and people learn: openhistoryproject.org

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