Tag: channel
How can I determine if a sound is playing? [AS3] Sound status Sound Channel Is playing?
by admin on Sep.10, 2008, under Other
How can I determine if a sound is playing? [AS3]
I need to determine if a sound is currently playing in a particular SoundChannel.
I need this since I call a function using onEventComplete to manage initiation of playback in two related sound channels, SC_A and SC_B.
In essence, when the latest sound has been completed in either SC_A or SC_B, I wish to call this function and start a new sound in the SC that completed.
Thus, if a sound in SC_A is currently playing, I wish to start the next parallell sound in SC_B and vice versa.
What property can I use to get this info?
Please advice…
Getting the length of audio file AS3 audio length
by admin on Aug.11, 2008, under Other
How do I get the length of an audio file? I need this value to set up a timer that depends on the length of the song playing.
I have tried the following, but only get a value of ZERO. The audio plays just fine. Please advice!
from my code:
var gettheme:URLRequest;
var nextA: Sound;
var SC_A:SoundChannel;
var songLong : Number = 5; // just to set a number
gettheme = “mysong.mp3″
nextA = new Sound(gettheme);
SC_A = nextA.play();
songLong = nextA.length;
trace(”Song length is: “, songLong );
If I try songLong = nextA.length(); // ie, .length();
I get an error:
1195: Attempted access of inaccessible method length through a reference with static type flash.media:Sound.
Please advice!