[FONT=Calibri][SIZE=3]How do I get the length of an audio file? [/SIZE][/FONT]
[FONT=Calibri][SIZE=3]I need this value to set up a timer that depends on the length of the song playing.[/SIZE][/FONT]
[FONT=Calibri][SIZE=3]I have tried the following, but only get a value of ZERO. [/SIZE][/FONT]
[FONT=Calibri][SIZE=3]The audio plays just fine. Please advice![/SIZE][/FONT]
[FONT=Calibri][SIZE=3]from my code:[/SIZE][/FONT]
[FONT=Calibri][SIZE=3]var gettheme:URLRequest;[/SIZE][/FONT]
[FONT=Calibri][SIZE=3]var nextA: Sound;[/SIZE][/FONT]
[FONT=Calibri][SIZE=3]var SC_A:SoundChannel;[/SIZE][/FONT]
[FONT=Calibri][SIZE=3]var songLong : Number = 5; // just to set a number[/SIZE][/FONT]
[SIZE=3][FONT=Calibri]gettheme = “mysong.mp3”[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]nextA = new Sound(gettheme);[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]SC_A = nextA.play(); [/FONT][/SIZE]
[SIZE=3][FONT=Calibri]songLong = nextA.length;[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]trace("Song length is: ", songLong );[/FONT][/SIZE]
[FONT=Calibri][SIZE=3]If I try songLong = nextA.length(); // ie, .length(); [/SIZE][/FONT]
[FONT=Calibri][SIZE=3]I get an error:[/SIZE][/FONT]
[FONT=Calibri][SIZE=3]1195: Attempted access of inaccessible method length through a reference with static type flash.media:Sound.[/SIZE][/FONT]
[FONT=Calibri][SIZE=3]Please advice![/SIZE][/FONT]
Jaxz