8 Replies Latest reply on Feb 19, 2007 2:35 AM by newmfa

    attach sound

    newmfa
      hi..
      is it easy to attach a wav sound file to w3d member in director..?

      newmfa
        • 1. Re: attach sound
          Level 7
          What do you mean, "attach a wav sound to w3d"? If you want a sound to
          play as soon as the w3d starts, you can add this script to the w3d sprite:

          on beginSprite me
          puppetsound ("nameOfSound")
          end

          If you want that sound to happen at some other time, just put the
          puppetsound command wherever is appropriate.

          If you want the sound to loop as long as the w3d sprite is on stage,
          then the easy way would be to set the sound to loop in the Property
          Inspector and add it to on of the sound channels in the score. Make
          sure it is on all the frames that the w3d sprite is on.
          • 2. Re: attach sound
            newmfa Level 1

            my w3d movie contains animation with 200 frames made in 3ds max 8..there is a wav sound I want to attach it to this movie but start at frame 50 in director..
            is there simple way to attach sound..?

            newmfa
            • 3. Re: attach sound
              tedalde2 Level 2
              The easiest way would be to measure the animation's keyframeplayer.currenttime property. This property represents elapsed time of keyframe animation in milliseconds. You can start the sound at precisely the right time that way:
              • 4. Re: attach sound
                newmfa Level 1

                the code with files names..

                on exitframe me
                ms = "w3d_ant".model("box").keyframeplayer.currenttime
                if (ms > 50) then
                puppetsound ("sfx_zez")
                end if
                end

                I got this error..

                script error: Handler not found in object..
                • 5. Re: attach sound
                  tedalde2 Level 2
                  It should be ms = member("w3d_ant")...

                  Also, note that 1000 milliseconds = one second, so 50 milliseconds is a very short time. You can also monitor what the keyframe time is by placing a put ms in there. The ms will show up in the message window.
                  • 6. Re: attach sound
                    newmfa Level 1

                    no messages error, but sound be very deform in its start track..! like repeating..!

                    newmfa
                    • 7. attach sound
                      tedalde2 Level 2
                      Yeah, you're right... sorry, bad code! It will play the sound over again every exitframe. You could _movie.go() to a new frame after puppetsound(), or, add a isPlayed property to the script. And you'd probably want a go the frame in there. As in:
                      • 8. Re: attach sound
                        newmfa Level 1

                        GOOD CODE..
                        thanks for your care

                        newmfa