A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: How do you get it to.....

  1. #1
    Junior Member
    Join Date
    Jan 2006
    Posts
    18

    How do you get it to.....

    play a scene once the document has been loaded using a preloader

    I know is like this, but I dont know what to enter to play scene one
    gotoAndPlay(????);

  2. #2
    Getting There! bitsk308's Avatar
    Join Date
    Jul 2000
    Location
    Phoenix, AZ
    Posts
    427
    the gotoAndPlay()/Stop() function only works to change scenes from the _root timeline. To get it to change based on input or events from clips or objects in the movie, you have to reference a function on the maintime line that holds the code for whatever scene you want to go to. When you want to go to scene two, say, add...
    code:
    _root.sceneSwap("two",1)

    ...to what ever code or object is controlling the scene change. Then this part would go on the _root. Make sure every scene has a stop action.

    code:
    function sceneSwap(sceneName:String, frameNumber:Number){
    switch(sceneName){
    case "one":
    gotoAndStop("one",frameNumber);
    break;
    case "two":
    gotoAndStop("two",frameNumber);
    break;
    case "three":
    gotoAndStop("three",frameNumber);
    break;
    case "main":
    gotoAndStop("main",frameNumber);
    break;
    }
    }


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