Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

New Here ,
Mar 09, 2015 Mar 09, 2015

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{

}

TOPICS
ActionScript
445
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 09, 2015 Mar 09, 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;

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 09, 2015 Mar 09, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 09, 2015 Mar 09, 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///

     }

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 09, 2015 Mar 09, 2015

I need to paste this code for each mp3, right?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 09, 2015 Mar 09, 2015

Yes, you will need to reference each MP3 in order to play it.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 09, 2015 Mar 09, 2015

im new at this, so, I don't know the structure ofhow to put all the code together....

¿where does this go?, ¿under my code or the middle? on top? etc

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///

     }

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 09, 2015 Mar 09, 2015

Shouldn't matter as you're likely using timeline code on frames...Put everything in frame 1 and you should be fine. You may need to do a little reading on basic coding in Flash.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 09, 2015 Mar 09, 2015

Yes I Do, I need to take a class on action script. Maybe next year around this time frame. I'm currently in a flash class now...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 09, 2015 Mar 09, 2015

what do these errors mean... I posted the new code you gave me on a new layer on its first frame and I got these messages .... Capture.PNG

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 09, 2015 Mar 09, 2015
LATEST

Duplicate function means you have two functions with the same name... probably songSelected that you pasted in. Remove one of them... Not sure about the other ones. Look like component errors.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines