Skip to main content
Participant
May 3, 2011
Question

How to play an instance of a sound in a soundchannel

  • May 3, 2011
  • 1 reply
  • 369 views

I have some sounds in my library that I want to play in a soundchannel, but how? This is what I have so far:

var music:Sound = new Sound();
var channel:SoundChannel = new SoundChannel();
var sTransform:SoundTransform = new SoundTransform();
var sound:SoundFile1 = new SoundFile1();  // Note: SoundFile1 is a class; in it is my soundfile in the library
// music.load(sound); ??
channel = music.play();

This topic has been closed for replies.

1 reply

Kenneth Kawamoto
Community Expert
Community Expert
May 3, 2011

It should be more like:

var music:Sound = new SoundFile1();

var channel:SoundChannel = music.play();