adding sounds to objects!!!
Being an awesome multimedia program as it is, Adobe Director allows us to add sounds to various objects. For instance, we can add our own little sounds to buttons and the like. Adding a sound to an element is as easy as counting your fingers. All you need is basic code which you can re-use day in and day out. [The wonderful nature of programming] :-). So let's add some sounds, in this tut, we'll just add the sound to a simple button.
Load Adobe D and then add the following code to your object (text, button, image).
Snippet 1
on mouseEnter
-
sound(2).play(member("button"))
end
This code added to your object named 'button', plays the sound in channel 2 whenever the cursor or mouse enters the area of the object. Naturally, you could have had these handlers instead:
Snippet 2
on mouseUp --plays sound whenever object is clicked
-
sound(2).play(member("button"))
end
or
Snippet 3
on mouseWithin me --plays sound as long as cursor remains
-
sound(2).play(member("button"))
end
That's all it takes!