A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: Controlling and playing scenes

  1. #1
    Junior Member
    Join Date
    Jan 2002
    Posts
    8

    Post

    i'm having trouble playing and controlling scenes. I have a preloader that is in a "preload" scene and then a "main" scene. Basically when the contents of "main" have been loaded by "preload" then it gotoAndPlay("main",1);

    What's happening is that the "main" scene is just showing up, and it's not playing any of the animation in the timeline of the scene.


  2. #2
    Member
    Join Date
    Jan 2002
    Posts
    50
    you have to give more details than that, because what you are saying should work.

    you should try thowing in trace() statements to see how far the movie head gets.

  3. #3
    Developer
    Join Date
    Sep 2001
    Location
    The Bluegrass State Will Flash For Food ™
    Posts
    3,789
    Originally posted by ironmang
    you have to give more details than that, because what you are saying should work.
    right... is there a stop asction on frame one of main? are you sure your using gotoAndPlay not gotoAndStop? can you preview the scene and it plays correctly?

  4. #4
    Junior Member
    Join Date
    Jan 2002
    Posts
    8
    There is definately no stop action on frame one of main, and i'm using gotoandplay. When i play the "main" scene the movie animation runs fine. When i preview it, it doesn't seem to work.

    What should i run the trace on?

  5. #5
    Developer
    Join Date
    Sep 2001
    Location
    The Bluegrass State Will Flash For Food ™
    Posts
    3,789
    what code are you using for the preloader?

  6. #6
    Junior Member
    Join Date
    Jan 2002
    Posts
    8
    I'm basically trying to follow the Advanced bytes-loaded Preloader by Cathode tutorial

    http://www.flashkit.com/tutorials/Ac...12/index.shtml


  7. #7
    Junior Member
    Join Date
    Jan 2002
    Posts
    8
    This is basically the main code that is being used for the preloader

    loadedbytes=getBytesLoaded();
    totalbytes=getBytesTotal();
    loadedkbytes=Math.ceil (loadedbytes/1000);
    totalkbytes=Math.ceil(totalbytes/1000);
    if (loadedbytes == totalbytes) {
    gotoAndPlay("main",1);
    ;
    }
    frame = int(loadedbytes/(totalbytes/100));
    tellTarget (_root.loader) {
    gotoAndStop (_root.frame);
    }

  8. #8
    Developer
    Join Date
    Sep 2001
    Location
    The Bluegrass State Will Flash For Food ™
    Posts
    3,789
    it probably won't make a difference but, get rid of the extra semicolin after gotoAndPlay

    gotoAndPlay("main",1);
    ;

    is main spelled correctly, it's not Main or Maine or Scene 1

    can you post your fla somewhere?

  9. #9
    Member
    Join Date
    Jan 2002
    Posts
    50
    have you tried using the tutorials fla and workin backwards from there?

    another thing- if you want to see trace statements you have to do test movie, because they do not show up in preview mode.

  10. #10
    Junior Member
    Join Date
    Jan 2002
    Posts
    8
    The file you'll want to look at is the loader.fla

    http://www3.telus.net/public/kellyco

    The tutorial actually has the same problem. I added a small animation to the scene in the original tutorial fla file and it doesn't bring up the animation.

  11. #11
    Developer
    Join Date
    Sep 2001
    Location
    The Bluegrass State Will Flash For Food ™
    Posts
    3,789
    i got rid of the tell target thing and umm... here...

    http://gsolo.com/temp/loader.fla

  12. #12
    Senior Member mzhang's Avatar
    Join Date
    Aug 2000
    Posts
    407

    YES

    Originally posted by brougham
    This is basically the main code that is being used for the preloader

    loadedbytes=getBytesLoaded();
    totalbytes=getBytesTotal();
    loadedkbytes=Math.ceil (loadedbytes/1000);
    totalkbytes=Math.ceil(totalbytes/1000);
    if (loadedbytes == totalbytes) {
    gotoAndPlay("main",1);
    ;
    }
    frame = int(loadedbytes/(totalbytes/100));
    tellTarget (_root.loader) {
    gotoAndStop (_root.frame);
    }

    YES..I have the SAME problem. ( even used nextScene(); )instead of ( gotoAndPlay("main",1); )


    I did this to figure out...

    1. in the MAIN scene (frame 1), adding action script of ( play(); )

    Buy the way...sometimes u don't need to add play(); in frame1. but it does work ( a bugs ?? don't know )

    Cheers

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