Sound.getTransform()
Availability
Flash Player 5.
Usage
my_sound.getTransform() : Object
Parameters
None.
Returns
An object with properties that contain the channel percentage values for the specified
sound object.
Description
Method; returns the sound transform information for the specified Sound object set with the last
Sound.setTransform()
Example
The following example attaches four movie clips from a symbol in the library (linkage identifier:
) that are used as sliders (or "knobs") to control the sound file that loads into the SWF
knob_id
file. These sliders control the transform object, or balance, of the sound file. For more
information, see the entry for Sound.setTransform(). Add the following ActionScript to your FLA
or AS file:
var my_sound:Sound = new Sound();
my_sound.loadSound("song1.mp3", true);
var transform_obj:Object = my_sound.getTransform();
this.createEmptyMovieClip("transform_mc", this.getNextHighestDepth());
transform_mc.createTextField("transform_txt",
transform_mc.getNextHighestDepth, 0, 8, 120, 22);
transform_mc.transform_txt.html = true;
var knob_ll:MovieClip = transform_mc.attachMovie("knob_id", "ll_mc",
transform_mc.getNextHighestDepth(), {_x:0, _y:30});
var knob_lr:MovieClip = transform_mc.attachMovie("knob_id", "lr_mc",
transform_mc.getNextHighestDepth(), {_x:30, _y:30});
var knob_rl:MovieClip = transform_mc.attachMovie("knob_id", "rl_mc",
transform_mc.getNextHighestDepth(), {_x:60, _y:30});
var knob_rr:MovieClip = transform_mc.attachMovie("knob_id", "rr_mc",
transform_mc.getNextHighestDepth(), {_x:90, _y:30});
knob_ll.top = knob_ll._y;
knob_ll.bottom = knob_ll._y+100;
knob_ll.left = knob_ll._x;
knob_ll.right = knob_ll._x;
knob_ll._y = knob_ll._y+(100-transform_obj['ll']);
knob_ll.onPress = pressKnob;
knob_ll.onRelease = releaseKnob;
758
Chapter 2: ActionScript Language Reference
call.
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?
Questions and answers