Professional Web Applications Themes

Urgent: Repeat loop and Film loop clash! - Macromedia Director Lingo

Hi All, Scenario I have a script running in which the spelling which was typed in by the student is corrected. The alphabets are moved to their correct positions to form the correct spelling and appropriate explanations are given to explain how the spelling could be corrected. When the sound is playing a 'repeat loop' is played in order to loop until the sound is done playing. After that the program proceeds to execute the next code block. Problem Now I have a animated character which will be narrating these sounds. The problem is that I have used a film ...

  1. #1

    Default Urgent: Repeat loop and Film loop clash!

    Hi All,


    Scenario

    I have a script running in which the spelling which was typed in by the
    student is corrected. The alphabets are moved to their correct positions to
    form the correct spelling and appropriate explanations are given to explain
    how the spelling could be corrected. When the sound is playing a 'repeat
    loop' is played in order to loop until the sound is done playing. After that
    the program proceeds to execute the next code block.

    Problem

    Now I have a animated character which will be narrating these sounds. The
    problem is that I have used a film loop for this animation and it gets
    slowed down a lot when the program goes into the repeat loop. The main
    problem I have is that the repeat loop cannot be eliminated. So somehow I
    have to make the repeat loop and the animation to play at the same time
    without much compromises.

    Please help me out with this.
    Thanks in advance.
    Regards,
    Jai G



    Jai G Guest

  2. #2

    Default Re: Urgent: Repeat loop and Film loop clash!

    In article <bg34ku$fpc$1forums.macromedia.com>, "Jai G"
    <logic_writer> wrote:
    > how the spelling could be corrected. When the sound is playing a 'repeat
    > loop' is played in order to loop until the sound is done playing. After that
    > the program proceeds to execute the next code block.
    >
    > Problem
    >
    > Now I have a animated character which will be narrating these sounds. The
    > problem is that I have used a film loop for this animation and it gets
    > slowed down a lot when the program goes into the repeat loop. The main
    > problem I have is that the repeat loop cannot be eliminated.
    If you want other things to happen while you are waiting for the sound to
    stop you have to get rid of the repeat loop. The only other way to do it
    is to put an updatestage command inside your repeat loop, which will
    advance the film loop but at a rate much faster than you would want.

    Use an exitframe handler to wait for the sound instead:

    on exitframe me
    if soundBusy(1) then
    go the frame
    end if
    end

    That will loop in one frame until the sound is done.

    Gretchen Macdowall
    [url]http://www.updatestage.com/[/url]
    Gretchen Macdowall Guest

  3. #3

    Default Re: Urgent: Repeat loop and Film loop clash!

    Hi,

    Thank you very much for replying to the message. But unfortunately I am
    unable to use 'exitframe' for my purpose. I have a script in which I have to
    call one narration after another using 'sound playfile' in between other
    program statements. First a narration is played (the program waits till
    sound is finished), the some codes are executed and then another narration
    is played and the program waits for it to finish. After that again some
    program statements are executed and so on. So I have to execute everything
    within a single script. Thus I do not know if 'exitframe' will be useful for
    my purpose.
    So what can I do if that is the case? Please suggest.

    Thank you.
    Jai G

    "Gretchen Macdowall" <gcmupdatestage.com> wrote in message
    news:gcm-2807031138400001192.168.1.102...
    > In article <bg34ku$fpc$1forums.macromedia.com>, "Jai G"
    > <logic_writer> wrote:
    >
    > > how the spelling could be corrected. When the sound is playing a 'repeat
    > > loop' is played in order to loop until the sound is done playing. After
    that
    > > the program proceeds to execute the next code block.
    > >
    > > Problem
    > >
    > > Now I have a animated character which will be narrating these sounds.
    The
    > > problem is that I have used a film loop for this animation and it gets
    > > slowed down a lot when the program goes into the repeat loop. The main
    > > problem I have is that the repeat loop cannot be eliminated.
    >
    > If you want other things to happen while you are waiting for the sound to
    > stop you have to get rid of the repeat loop. The only other way to do it
    > is to put an updatestage command inside your repeat loop, which will
    > advance the film loop but at a rate much faster than you would want.
    >
    > Use an exitframe handler to wait for the sound instead:
    >
    > on exitframe me
    > if soundBusy(1) then
    > go the frame
    > end if
    > end
    >
    > That will loop in one frame until the sound is done.
    >
    > Gretchen Macdowall
    > [url]http://www.updatestage.com/[/url]

    RaveN J Guest

  4. #4

    Default Re: Urgent: Repeat loop and Film loop clash!

    > First a narration is played (the program waits till
    > sound is finished), the some codes are executed and then another narration
    > is played and the program waits for it to finish. After that again some
    > program statements are executed and so on. So I have to execute everything
    > within a single script.
    You'd still be better off restructuring it so that you have a list of
    handlers you call in order, checking your status on an exitframe. To keep
    what you have you could add a timer to try to execute an updatestage at
    intervals similar to your framerate. Assuming your framerate is 10fps:

    global lastCheck

    lastCheck = the ticks
    repeat while something
    -- other code
    now = the ticks
    elapsed = now - lastCheck
    lastCheck = now
    if elapsed > 6 then
    updateStage -- advance film loop
    end if
    end repeat

    Gretchen Macdowall
    [url]http://www.updatestage.com/[/url]
    Gretchen Macdowall Guest

  5. #5

    Default Re: Urgent: Repeat loop and Film loop clash!

    Hi Gretchen,

    Thanks a lot for this suggestion. It was very helpful.
    Have a great day!
    Regards,
    Jai G

    "Gretchen Macdowall" <gcmupdatestage.com> wrote in message
    news:gcm-3007031857200001192.168.1.102...
    > > First a narration is played (the program waits till
    > > sound is finished), the some codes are executed and then another
    narration
    > > is played and the program waits for it to finish. After that again some
    > > program statements are executed and so on. So I have to execute
    everything
    > > within a single script.
    >
    > You'd still be better off restructuring it so that you have a list of
    > handlers you call in order, checking your status on an exitframe. To keep
    > what you have you could add a timer to try to execute an updatestage at
    > intervals similar to your framerate. Assuming your framerate is 10fps:
    >
    > global lastCheck
    >
    > lastCheck = the ticks
    > repeat while something
    > -- other code
    > now = the ticks
    > elapsed = now - lastCheck
    > lastCheck = now
    > if elapsed > 6 then
    > updateStage -- advance film loop
    > end if
    > end repeat
    >
    > Gretchen Macdowall
    > [url]http://www.updatestage.com/[/url]

    Jai G Guest

Similar Threads

  1. repeat loop
    By yogeshhungama in forum Macromedia Director 3D
    Replies: 0
    Last Post: August 20th, 09:25 AM
  2. End of film loop
    By hws_sentry in forum Macromedia Director Basics
    Replies: 2
    Last Post: April 15th, 04:06 AM
  3. Can a film loop play once, then loop on the last frame(s)?
    By Schiemer webforumsuser@macromedia.com in forum Macromedia Director Lingo
    Replies: 0
    Last Post: November 29th, 03:35 AM
  4. Film loop rollovers working with tell sprite, but only if Loop is checked
    By Schiemer webforumsuser@macromedia.com in forum Macromedia Director Basics
    Replies: 0
    Last Post: November 27th, 06:02 AM
  5. Urgent Please :- Updatestage in Film Loop
    By Logic Writer in forum Macromedia Director Lingo
    Replies: 2
    Last Post: August 29th, 04:41 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139