3 Replies Latest reply on Nov 13, 2006 8:35 AM by Newsgroup_User

    Play SX once only

    mirianam Level 1
      I am not sure where to put the code for playing a sound fx - obviously putting it on exitFrame is no good as it plays on each exitFrame!
      I do not want to go to another frame of the movie as I want the position of all sprite to remain where they are and some are still animating.
      Does anyone have any suggestions.
      Thank you

      on exitFrame me
      if sprite("man").locV <= 210 then
      sprite("instructions").loc = point (1000,1000)
      sprite("WellDoneTXT").loc = point (150, 255)
      sprite("WellDoneStar").loc = point(348, 314)
      sprite("tally").member = member(27)
      sound(4).play(member("BellTransition")) -- my sound fx
      end if
      end
        • 1. Re: Play SX once only
          Level 7
          There are many ways to do it but if you have a repeating exitFrame in one
          frame or an exitFrame script spanning many frames this will work

          property pSoundPlayed

          on beginSprite me
          pSoundPlayed = FALSE
          end

          > on exitFrame me
          > if sprite("man").locV <= 210 then
          > sprite("instructions").loc = point (1000,1000)
          > sprite("WellDoneTXT").loc = point (150, 255)
          > sprite("WellDoneStar").loc = point(348, 314)
          > sprite("tally").member = member(27)
          if pSoundPlayed = FALSE then
          pSoundPlayed = TRUE
          > sound(4).play(member("BellTransition")) -- my sound fx
          end if
          > end if
          > end
          >


          • 2. Re: Play SX once only
            mirianam Level 1
            Many thanks - works perfectly
            • 3. Re: Play SX once only
              Level 7
              You're welcome

              "mirianam" <webforumsuser@macromedia.com> wrote in message
              news:ej8prr$o0b$1@forums.macromedia.com...
              > Many thanks - works perfectly