Skip to main content
December 10, 2012
Question

Changing the directory of files

  • December 10, 2012
  • 1 reply
  • 289 views

I'm trying to make it so that I can have the mp3 files in the same location as the fla file. I don't know what I should change the ../MP3s/  to so that flash will know to load the files from the same location as the flash file. Thanks!

//switch statement to set the current song based on which song button was clicked.

function chooseSong(e:MouseEvent):void {

          switch (e.currentTarget.name) {

                    case "song1":

                              currSong = "../MP3s/"+songList[0] as String;

                              break;

                    case "song2":

                              currSong = "../MP3s/"+songList[1] as String;

                              break;

                    case "song3":

                              currSong = "../MP3s/"+songList[2] as String;

                              break;

                    case "song4":

                              currSong = "../MP3s/"+songList[3] as String;

                              break;

                    case "song5":

                              currSong = "../MP3s/"+songList[4] as String;

                              break;

                    case "song6":

                              currSong = "../MP3s/"+songList[5] as String;

                              break;

          }

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
December 10, 2012

use:

function chooseSong(e:MouseEvent):void {

          switch (e.currentTarget.name) {

                    case "song1":

                              currSong = songList[0] as String;

                              break;

                    case "song2":

                              currSong = songList[1] as String;

                              break;

                    case "song3":

                              currSong = songList[2] as String;

                              break;

                    case "song4":

                              currSong = songList[3] as String;

                              break;

                    case "song5":

                              currSong = songList[4] as String;

                              break;

                    case "song6":

                              currSong = songList[5] as String;

                              break;

          }