A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: gotoAndPlay(scene) problems...

  1. #1
    Junior Member
    Join Date
    Dec 2002
    Posts
    2

    gotoAndPlay(scene) problems...

    I'm new to Flash MX but have gone through both Training From the Source books. Right now I have a project with currently three scenes in it. Scene 1 is a preloader, scene 2 is an "intro", and scene 3 will be the actual usable document.

    The preloader works wonderfully and detects if 90% of it is downloaded... if so it goes to scene 2 by doing:

    _root.gotoAndPlay (2);

    Scene 2's name is "Intro". I am assuming the the "2" means go to frame 2 of scene 1 and since there is not frame 2 in scene 1 it just goes to scene 2 automtically. That's just fine.

    So during the intro I have a "Skip" button so you don't have to watch it if you prefer. The action attached to the instance of the button is:

    on (release) {
    _root.gotoAndPlay(216);
    }

    This goes 1 frame past the intro but doesn't go to the next scene. I was looking at gotoAndPlay and it says it can take a parameter of a (scene, frame) so I tried changing it to _root.gotoAndPlay("Main Menu", 1); but that didn't work either. The button doesn't do anything then.

    Is there something wrong with the actionscript for the button or something wrong with my "Main Menu" scene?

    Thanks for your time,

    Chris

  2. #2
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    Hi,

    You need to put a frame label on the first frame (or whichever frame you want to go to) within your scene, then your action within the clip can be,

    _root.gotoAndPlay("yourFrameLabelName");

  3. #3
    Junior Member
    Join Date
    Dec 2002
    Posts
    2

    Thanks!

    That worked just wonderfully! Thanks a lot!

    Chris

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