How do I access Timeline sounds from Actionscript? The sounds have to be in the timeline for my current animation, as the animation is timed to the sound. But other parts of the animation need to react to the sound's amplitude via actionscript 3. Is it possible to do this? Thanks,
embeddeding sounds in the timeline limits your ability to work with those sounds. Much better to work with the Sound Class
however, for timeline embedded sounds you can at least do simple things like manipulate the volume , and pan working with the SoundMixer class. this will of course effect all sounds playing.
you would control the SoundMixer like this:
SoundMixer.soundTransform = new SoundTransform( .5, -1);
where the first parameter ( .5 in this example) controls the volume , and the second, the pan value ( -1 being full left and no right channel ).
if you need to trigger events based on the amplitude of the sound, i am not sure that that is possible directly from timeline embedded sounds. it is possibly better to trigger those events based on the frames from which they occur.
choosing to use library sounds instantiated with the Sound Class, you can actually get to the sound wave properties and access amplitude info. i've done this( a while ago) to make sound waveform visualizers, but not much else.