This content has been marked as final. Show 8 replies
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
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.
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..?
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:
the code with files names..
on exitframe me
ms = "w3d_ant".model("box").keyframeplayer.currenttime
if (ms > 50) then
I got this error..
script error: Handler not found in object..
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.
no messages error, but sound be very deform in its start track..! like repeating..!
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:
thanks for your care