• home
  • forum
  • my
  • kt
  • download
  • Home / 2D Graphics / Flash / Audio /

    How To Create A Simple Mp3 Player In Flash

    Author: 2008-10-14 14:52:22 From:

    How to create a simple audio player using the sound class:

    • In the library panel:
      • Drag the "play_btn" and the "stop_btn" on stage.
      • Then right click on the sound file "matts_blues" and select "linkage" from the drop down menu.
      • In the "linkage properties" window:
        • Check the "Export for Actionscript" check box.
        • Press the "OK" button.
    • On stage:
      • Select the play button then in the properties panel set the instance name to "play_btn".
      • Then select the stop button and in the properties panel set the instance name to "stop_btn".
    • In the timeline:
      • Select the first frame in the "actions" layer.
    • Then open the actionscript panel and add the following script:

    var my_sound:Sound = new Sound();
    my_sound.attachSound("matts_blues");

    play_btn.onRelease = function(){
    my_sound.start();
    }
    stop_btn.onRelease = function(){
    my_sound.stop();
    }

    • In the main menu go to Control > Test Movie.

    discuss this topic to forum

    relation tutorial

    No relevant information

    Category

      3D (20)
      Math Physics (14)
      3rd Party (5)
      Navigation (60)
      Actionscripting (26)
      Optimization (16)
      Animation (32)
      Projector (9)
      Audio (50)
      Special Effects (152)
      Backend (26)
      Text Effects (82)
      Drawing (32)
      Tips and Techniques (47)
      Dynamic Content (31)
      Tricks (8)
      Games (97)
      Utilities (21)
      Getting Started (91)
      Video (24)
      Interactivity (43)
      Web Design (29)

    New

    Hot