828
ActionScript classes
audio_sound.setVolume(audio_sound.getVolume()-10);
updateVolume();
}
};
// Updates the volume.
this.createTextField("volume_txt", this.getNextHighestDepth(), 0, 0, 100,
22);
updateVolume();
function updateVolume() {
volume_txt.text = "Volume: "+audio_sound.getVolume();
}
The following example specifies a microphone as the audio source for a dynamically created
movie clip instance called
audio_mc
:
var active_mic:Microphone = Microphone.get();
this.createEmptyMovieClip("audio_mc", this.getNextHighestDepth());
audio_mc.attachAudio(active_mic);
The
MovieClip.getNextHighestDepth()
method used in this example requires Flash Player
7 or later. If your SWF file includes a version 2 component, use the version 2 components
DepthManager class instead of the
MovieClip.getNextHighestDepth()
method.
See also
Microphone
,
play (NetStream.play method)
,
Sound
,
attachVideo
(Video.attachVideo method)
attachBitmap (MovieClip.attachBitmap method)
public attachBitmap(bmp:BitmapData, depth:Number, [pixelSnapping:String],
[smoothing:Boolean]) : Void
Attaches a bitmap image to a movie clip.
After the bitmap is attached to the movie clip, a reference is made from the movie clip to the
bitmap object. When attaching a bitmap, you can specify
pixelSnapping
and
smoothing
parameters to affect the appearance of the bitmap.
After an object is added to the movie clip, it is not an accessible object. The
depth
,
pixelSnapping
, and
smoothing
parameters can only be set during the
attachBitmap()
method call and cannot be changed later.
First use the
createEmptyMovieClip()
to create an empty movie clip, then use the
attachBitmap()
method. This way, you can apply transformations to the movie clip to
transform the bitmap; for example, by using the
matrix
property of the movie clip.
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...