A Flash Developer Resource Site

Page 2 of 2 FirstFirst 12
Results 21 to 24 of 24

Thread: how to play scene 1 for 20 seconds before scene 2

  1. #21
    Member
    Join Date
    Feb 2002
    Posts
    57

    Post

    i dont know how the stuff the guys said doesnt work for you. All those ways work, but if you want the easiest, it would be IMO to make a blank movieclip that has blank frames in it except the last frame which says "go to and play" your scene that you want.

    If you want approximately 20 sec, and your running your animation at 18 Fps, then just make a movie clip with 360 frames in it (18fps * 20sec). When it reaches frame 360, appx. 20 sec will have elapsed and you can have it send you to the next scene. This would be your timer i guess.

    Of course this may be the easyest but also the one with least control. GetTimer is a better solution for exact measurements.

    Anyway Gl with it, let us know what happens.

  2. #22
    damn, im smooth drkknght's Avatar
    Join Date
    Feb 2001
    Posts
    159
    wuhoo!!

    heya guys... cant thank you all enough for the help!!! ill start messing around with these more tonight.

    unfortunately, my first test runs this afternoon didnt go so well (i have a feeling my own code in the scene itself on the other items is conflicting... more than likely cuz the playhead is already scrolling form frame 2-10, then jumping back to 2 again, over and over).

    anyway, just wanted to make sure i thanked you all for your help, regardless of if it works -- its definitley appreciated!!!!!

  3. #23
    Junior Member
    Join Date
    Jan 2002
    Posts
    16

    SIZE!!!

    Don't act stupid, quantity doesn't make something less confusing! Especially in a computer language!

    Mine doesn't use miliseconds mine uses actual seconds, I think that is a little bit less confusing, plus one can activate it anytime one wants with simple tricks of a movie clip.

    I know yours works, that is not what coding is all about. That is not what this logic is all about. This logic is about having many ways to figure a problem, as I said before I was giving the kid another option to enhance the subject and to enhance the logic of the situation.

    Plus, I don't think you know what my code does exactly. Maybe you should review it again, it is posted up higher .


  4. #24
    Member
    Join Date
    Sep 2000
    Posts
    45

    Smile Re: SIZE!!!

    Originally posted by jseinfield
    Don't act stupid, quantity doesn't make something less confusing! Especially in a computer language!

    Mine doesn't use miliseconds mine uses actual seconds, I think that is a little bit less confusing, plus one can activate it anytime one wants with simple tricks of a movie clip.

    I know yours works, that is not what coding is all about. That is not what this logic is all about. This logic is about having many ways to figure a problem, as I said before I was giving the kid another option to enhance the subject and to enhance the logic of the situation.

    Plus, I don't think you know what my code does exactly. Maybe you should review it again, it is posted up higher .

    Heeeey, peace brother. you don't have to call someone stupid just because they're correcting your code, i'm just trying to point out that your script is flawed. also, quantity *does* mean something in a computer language. the less lines of code it has to process, the more efficient it runs. i understand exactly what your script does, so let me explain to you why it won't work all of the time. here is your code:

    mydate = new Date();
    sec = mydate.getSeconds();
    x = sec + 20;
    //have the above coding played once

    sec = mydate.getSeconds();
    if(sec >= x)
    {
    gotoandPlay(scene 2, 1);
    }

    Your code calls the internal computer's clock and queries the seconds. However, that will only return a number from 0 to 59, because the seconds roll over to 0 as the minute is increased by 1. So if the first part of your script is invoked while the seconds are at 45... x will equal 65 because 45 + 20 = 65. But whenever you check mydate.getSeconds() it will never be 65, at that point it will be returning 5 because it ROLLS OVER the minute and begins again at 0. Get it? Your script will be hung up looking for 65 and never progressing. Have you ever seen a watch with a second hand that counts to 65? So what's so hard about getTimer()? I do not think having to count in milliseconds is very confusing at all. It's very simple math. Is 20 * 1000 that confusing to you? but hey, let's all chill and have fun with this, no need to get ruffled over it .

    [Edited by nicholas.w on 02-09-2002 at 03:40 AM]

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