A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Going to a certain Frame?

  1. #1
    Junior Member
    Join Date
    Oct 2006
    Posts
    10

    Going to a certain Frame?

    Does anyone know the command for going to a certain frame in your flash application/movie thing... -_-

    ~Arty

    P.S. - It's for a flash menu too..
    Last edited by Arty_Digital; 11-12-2006 at 01:04 AM. Reason: I need a reason? Who knew..?

  2. #2
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    well not knowing what your movie is called or where it is..

    the basic command is:

    gotoAndPlay();
    or gotoAndStop();

    you can out the frame name or the frame number in the ().

  3. #3
    Member
    Join Date
    Oct 2006
    Location
    tampa, Fl
    Posts
    51
    You should have tried opening up the Flash Help. It's much quicker than waiting for a response here... ...and it's very helpful. Nonetheless...I'll just post what it says in help:

    Jumping to a frame or scene
    To jump to a specific frame or scene in the SWF file, you can use the gotoAndPlay() and gotoAndStop() global functions or the equivalent MovieClip.gotoAndPlay() and MovieClip.gotoAndStop() methods of the MovieClip class. Each function or method lets you specify a frame to jump to in the current scene. If your document contains multiple scenes, you can specify a scene and frame where you want to jump.

    The following example uses the global gotoAndPlay() function within a button object's onRelease event handler to send the playhead of the timeline that contains the button to Frame 10:

    jump_btn.onRelease = function () {
    gotoAndPlay(10);
    };


    In the next example, the MovieClip.gotoAndStop() method sends the timeline of a movie clip instance named categories_mc to Frame 10 and stops. When you use the MovieClip methods gotoAndPlay() and gotoAndStop(), you must specify an instance to which the method applies.

    jump_btn.onPress = function () {
    categories_mc.gotoAndStop(10);
    };


    In the final example, the global gotoAndStop() function is used to move the playhead to Frame 1 of Scene 2. If no scene is specified, the playhead goes to the specified frame in the current scene. You can use the scene parameter only on the root timeline, not within timelines for movie clips or other objects in the document.

    nextScene_mc.onRelease = function() {
    gotoAndStop("Scene 2", 1);
    }
    So the frame you want to go to is placed in the "()"
    ex: gotoAndPlay(10);

  4. #4
    tunnel vision Adixx's Avatar
    Join Date
    Apr 2001
    Location
    nomad
    Posts
    398
    to a button:

    on (release) {
    gotoAndPlay(10);
    }
    Freebies:
    Sound Loops | Sound Effects | Images | Code Pigs | 6ood coff33


    The marvel of all history is the patience with which men and women submit to burdens unnecessarily laid upon them by their governments.

  5. #5
    Junior Member
    Join Date
    Oct 2006
    Posts
    10
    Thank you all for that information! I tested it for about 20 minutes and finally got the command to work.

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