A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Playing mp3 sound from file WITHOUT importing in library.

  1. #1
    Member
    Join Date
    Mar 2014
    Posts
    32

    Playing mp3 sound from file WITHOUT importing in library.

    So I have this mp3 file and "play" button on stage. Could it be possible to play the mp3 code without importing it in the library, since it would be changed in the future(with the same title, just different mp3 file). I have the mp3 file in the same folder as the fla file. Another question would be, should I write the code ON the button, or on the first frame in the layer where the button is, or should I make another layer above the button as an AS layer and write the code there?

    on(release){
    play.new Sound("sound.mp3")
    }
    obviously, its not doing anything with this code....

  2. #2
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,785
    Hi,

    There are many thing you can add to the music stuff if you look around, like volume, pan, detect end of song and much much more.

    PHP Code:
    mySound = new Sound();
    mySound.loadSound("sound.mp3"true); 

  3. #3
    Member
    Join Date
    Mar 2014
    Posts
    32
    Thank You, fruitbeard! Works amazing!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center