Sound Transform not working
hey guys,
i'm getting silly little problem. i'm making sound play , i'm trying change it's volume. i've done many times before , got work, in script reason it's not working. script looks :
package {
import flash.media.sound;
import flash.media.soundchannel;
import flash.media.soundtransform;
public class main
{
var createsound:create;
var createchannel:soundchannel;
var createtransform:soundtransform;
public function main()
{
createsound = new create();
createchannel = new soundchannel();
createtransform = new soundtransform();
createtransform.volume = 0.5;
createchannel.soundtransform = createtransform;
createchannel = createsound.play();
}
}
}
for reason, plays sound, @ full volume no matter value put in createtransform.volume variable. i've gotten same exact code working in other games i've made, dunno why isn't working in one
try:
package {
import flash.media.sound;
import flash.media.soundchannel;
import flash.media.soundtransform;
public class main
{
var createsound:create;
var createchannel:soundchannel;
var createtransform:soundtransform;
public function main()
{
createsound = new create();
createchannel = new soundchannel();
createtransform = new soundtransform();
createtransform.volume = 0.5;
// in order
createchannel = createsound.play();
createchannel.soundtransform = createtransform;
}
}
}
More discussions in ActionScript 3
adobe
Comments
Post a Comment