The playback of audio files through Flash Platform runtimes on Android devices is fairly straightforward. We can point to files bundled with our application, as this recipe demonstrates, files on the device storage, or files over a remote network connection. No matter where the file is located, playback is accomplished in the same way.
We must load the audio file into a Sound
object and will then have the ability to manipulate playback, volume, pan, among other properties. In this recipe, we will allow the user to control volume through the rotation of a basic dial:
1. First, import the following classes into your project:
import flash.display.Sprite; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.events.TransformGestureEvent; import flash.media.Sound; import flash.media.SoundChannel; import flash.media.SoundTransform; import flash.net.URLRequest; import flash.text.TextField; import flash...