A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Mp3

  1. #1
    Member
    Join Date
    May 2004
    Location
    Netherlands
    Posts
    58

    Mp3

    Hai,

    is there someone who can tell me how to load and start a mp3 file on the server when pusing a button.

    I used:

    on(release){
    var song1 = new Sound();
    song1.loadSound("fs.mp3", true);song1.start();
    }

    but it doesn't work.

    greetings and thanks in advance

  2. #2
    Getting better day by day.....
    Join Date
    Mar 2005
    Location
    United Kingdom
    Posts
    79
    Just been through the same thing.
    Here is the example i was sent from Tim which sent me on my way.
    http://www.diversioncentral.com/mp3/t.zip
    Hope this helps

    Martyn

  3. #3
    Member
    Join Date
    May 2004
    Location
    Netherlands
    Posts
    58

    But

    Imladris,

    thanks for the support but i can't get the sound to play with a press on a button. Is there anybody who knows how to start a sound with a pres on a button? For example i have two or more mp3 songs and when i click one it will be loaded and then press the play button to hear it.

    thanks again.

  4. #4
    Relaxing tmoore935's Avatar
    Join Date
    Oct 2001
    Location
    colorado, usa
    Posts
    1,713
    Check the export settings. If you look at my previous threads, I made a player that uses action script to go to another frame and play a movie. If you cannot find it, then i will upload it when i get off work. Also go to the sound forum here at flaskfit and read the sticky called FAQ. There is a complete list of all you wanted to know about mp3's.

    (My upload may be missing since I was forced to remove all my files when the new forum was created)
    Any programming language is at its best before it is implemented and used.

  5. #5
    Relaxing tmoore935's Avatar
    Join Date
    Oct 2001
    Location
    colorado, usa
    Posts
    1,713
    T play a song at the touch of a button:

    In the frame have:

    volume = 50;

    The button has:

    on (press) {

    _root.Sound = new Sound();
    //to load
    _root.Sound.LoadSound("nice.mp3");
    _root.Sound.start();


    }
    Any programming language is at its best before it is implemented and used.

  6. #6
    Member
    Join Date
    May 2004
    Location
    Netherlands
    Posts
    58

    playing MP3

    Tmoore935,

    I will read and learn, but in the mean time thank you verry much for the solution.

    greetings Rob

  7. #7
    Thick as a Brick bobgodwin's Avatar
    Join Date
    Sep 2003
    Location
    Metro Detroit
    Posts
    217
    Here's what I use:
    For frame event:

    mySnd = new sound();
    mySnd.setvolume(100);
    mySnd.setpan(0);
    mySnd.loadsound("yourmp3.mp3", true);

    For button:

    on(release){mySnd = new sound();
    mySnd.setvolume(100);
    mySnd.setpan(0);
    mySnd.loadsound("yourmp3.mp3", true);

    }

    If you need to unload a sound first, add this first:

    on(press){stopAllSounds();

    }

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