I have a problem with actionscript 3, especially when using the embed tag. I have this code:
[Embed(source = "sound.mp3")]
private static var soundClip:Class;
...
var sound:Sound = (new soundClip()) as Sound;
trace(sound.length);
When I test the movie, I get the following output : 4501,923 Which is the sound.mp3 length in milliseconds. However, the original sound is 13.000 milliseconds.
How can that be possible, can anyone help me please?
Thank you.
var sound:Sound = new SoundAssets.soundclip() as Sound;
The way you have it above, you would need your embedded symbol to lose the 'static' :private var soundClip:Class;
– SummandsoundClip.play();
(whole duration), however, some of them have smaller duration. I guess that the problem is caused by the audio format. Sound's format is : mp3, bitrate: 128kbps, sample rate: 44100 Hz – Mickpackage { import flash.display.Sprite; public class Test extends Sprite { public static var s:String = "static"; public var i:String = "instance"; public function Test():void{ trace(s); trace(i); } } }
– Sandfly