Skip to main content
ChicoPegaPega
Participating Frequently
March 9, 2015
Question

How do i Make mp3 files play when i make a list using its component in flash cc?

  • March 9, 2015
  • 1 reply
  • 504 views

I made a list of mp3 songs using the list component in Flash CC, but they do not play.

¿Is there a function that I am missing? I thought I could make a playlist using the list component,

I used the following code... I'd appreciate the help.

MP3Playlist.addItem( { label: "Tatuaje.mp3" } );

MP3Playlist.addItem( { label: "08 Mi Ultimo Adios.mp3" } );

MP3Playlist.addItem( { label: "La Noche del Sabado.mp3" } );

MP3Playlist.addItem( { label: "Dime.mp3" } );

MP3Playlist.addItem( { label: "Regresaré.mp3" } );

MP3Playlist.addItem( { label: "Por Decision Unanime.mp3" } );

MP3Playlist.addItem( { label: "Promesas.mp3" } );

MP3Playlist.addItem( { label: "Maldito.mp3" } );

MP3Playlist.addItem( { label: "Confidente.mp3" } );

MP3Playlist.addItem( { label: "Olvidate de El.mp3" } );

MP3Playlist.addItem( { label: "180 UN POCO DE TIEMPO.mp3" } );

MP3Playlist.addItem( { label: "Caballito de Mar.mp3" } );

MP3Playlist.addItem( { label: "188 LA RECORDARE.mp3" } );

MP3Playlist.addItem( { label: "12 Tan Solo.mp3" } );

MP3Playlist.addItem( { label: "No Llores Mi Niña.mp3" } );

MP3Playlist.addItem( { label: "PIPIPARAOOOO.mp3" } );

MP3Playlist.addItem( { label: "05 me haces falta.mp3" } );

MP3Playlist.addItem( { label: "EL RECREO.mp3" } );

MP3Playlist.addEventListener(Event.CHANGE, songselected);


function songselected (event:Event):void{

}

This topic has been closed for replies.

1 reply

Inspiring
March 9, 2015

All you have there is a list with some text labels in it. You need to, within songSelected, now play the selection. You can get the selection using selectedItem.label... or data if you use it which might be better:

function songselected (event:Event):void{

var selectedSong = MP3Playlist.selectedItem.label;

}

ChicoPegaPega
Participating Frequently
March 9, 2015

I pasted your code over my code, and they still don't play ... My goal is to makea playlist, and I thought I could make it with the list component

Inspiring
March 9, 2015

Right... as I mentioned all you have is a list component with TEXT labels. You need to now associate those labels with a Sound object. Something like so:

var mySound:Sound;

function songselected (event:Event):void{

     var selectedSong = MP3Playlist.selectedItem.label;

     switch(selectedSong){

          case "Tatuaje.mp3":

               mySound = new tatuaje(); //library sound

               mySound.play();

               break;

          //etc///

     }

}