Test for MP3 capabilities using the flash.system.Capabilities.hasMP3 property : System.Capabilities : Development Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Development » System.Capabilities »

 

Test for MP3 capabilities using the flash.system.Capabilities.hasMP3 property


 

package{
  import flash.display.Sprite;
  import flash.system.Capabilities;
  import flash.net.*;
  import flash.media.*;
  public class Main extends Sprite{
    public function Main(){

        if (flash.system.Capabilities.hasMP3) {
          var url:URLRequest = new URLRequest("sound.mp3");
          var sound:Sound = new Sound(url);
          sound.play(  );
        else {
          // code to load an external .swf containing a ADCP sound
        }
    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Development
» System.Capabilities