3 Replies Latest reply on Sep 3, 2007 7:42 AM by kglad

    Playing MP3 in library (AS3)

    richtextformat Level 1
      hey everybody! :)

      ok, so, i've got an mp3 in the library of my FLA here and i simply want a AS3 command that will play it.

      i've tried new Sound() but that wants to load an external mp3. i've tried to make this simpler (obviously not........) AND avoid potential network errors - as preloading is not a worry in this particular project - by putting the sound right in the library and exporting on frame 1.

      i've tried giving the mp3 a class linkage in the library. i called the class 'SoundDogs.as' and chose to extend flash.media.sound. when compiling the swf i got this error:

      1046: Type was not found or was not a compile time constant: SoundDogs

      now i know this works and taht i don't have to use 'import' as i have another library asset - visual one this time - linked to 'KaleidoscopeAssetSwallow' and the line:

      _swallow = new KaleidoscopeAssetSwallow();

      works fine, i get my swallow onstage.

      how then can i do the same for sounds?

      :S