07.12.2012 Views

Adobe Director Basics

Adobe Director Basics

Adobe Director Basics

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ADOBE DIRECTOR BASICS<br />

Audio mixers and sound objects<br />

Creating a new sound object<br />

You can create a new sound object in two different ways:<br />

Use the [+] button in the Audio Mixer Inspector. See “Adding a sound object to a mixer” on page 407 for details<br />

Use the mixer.createSoundObject() method<br />

Sound object methods<br />

Use the following methods to modify the sound object:<br />

soundObject.moveTo(): moves the sound object to a different mixer<br />

soundObject.replaceMember(): changes the cast member audio source<br />

Note: In <strong>Director</strong> 11.5.8, soundObject.replaceMember() fails unless a second parameter with the value<br />

[#loopCount: 0] is used. This will lead to the sound repeating continuously. There are also issues with setting<br />

soundObject.loopCount = 1. If you want to change the sound member without looping the sound forever, the simplest<br />

workaround is to use a handler like the one below.<br />

on ReplaceSoundObjectMember(aSoundObject, aMember)<br />

vName = aSoundObject.name<br />

vMixer = aSoundObject.mixer<br />

vFilterList = aSoundObject.filterList<br />

vMixer.deleteSoundObject(aSoundObject)<br />

vSoundObject = vMixer.createSoundObject(vName, aMember)<br />

vCount = vFilterList.count<br />

repeat with ii = 1 to vCount<br />

vFilter = vFilterList[ii]<br />

vSoundObject.filterList.append(vFilter)<br />

end repeat<br />

return vSoundObject<br />

end ReplaceSoundObjectMember<br />

Note that this code will replace any customized values for the properties of the sound object with default values. You may<br />

need to use a similar technique to the one used for audio filters to transfer the custom property values from the old sound<br />

object to the new one.<br />

Use the following methods to control playback of a sound object:<br />

soundObject.breakLoop()<br />

soundObject.mute()<br />

soundObject.pause()<br />

soundObject.play()<br />

soundObject.seek()<br />

soundObject.stop()<br />

soundObject.unmute()<br />

Use the following methods to save the sound object to a file on a local drive:<br />

soundObject.save()<br />

soundObject.startSave()<br />

soundObject.stopSave()<br />

Last updated 8/26/2011<br />

403

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!