PDA

View Full Version : Drive letter


Johansen
06-17-2007, 02:46 AM
Hello

I have made a music cd that runs automatically with an autorun.inf. It opens a flash movie that serves as a menu. From there I open a flash-player, that handle the music through a songlist.xml.
Everything works fine, as long as the drive-letter is D:

My question is therefore, how can I make it run from any drive-letter?

Many regards Johansen

twall
06-17-2007, 03:02 AM
can you post some code?

evride
06-17-2007, 04:45 AM
you can try relative paths. if your mp3 player is in the directory D:\program and the music is in D:\music you can do this.
"../music/file.mp3"

but if the music folder is inside the program folder all you have to do is this
"music/file.mp3"

might try something like this too
the_url= _root._url;
var drive = the_url.charAt(9); \\i dont know what the character number is. guess and check till you get the drive letter.

//then create the url based on that variable

file_url = "file:///"+drive+":\music\file.mp3";

Johansen
06-17-2007, 11:40 PM
can you post some code?

Thank you very much for your reply.

My Flash-movie/menu is in the root, from where the autorun.inf starts it.

In the flash-movie/menu, a bottom starts the Flash-Player with the following script:

on (press) {
loadMovieNum("Root\\Player\\st_03aB50.swf", 1);

The song list has the following script:

<song display="Willkommen"
url="mp3/Willkommen.mp3" />

mp3 is the folder, containing the sound files.

I have by this, tried to avoid a directly reference to a specific drive-letter, but it only works on a computer with a D: drive-letter.:)

I have very little knowledge about this, and might overlook some very simple things, but I’m stucked and need help to make it work on any computer, regardless of drive-letter.

I hope this makes it more clear allthough I also lack the ability to write in the terminology of this world of scripts.:)

Regards Johansen

Johansen
06-17-2007, 11:43 PM
you can try relative paths. if your mp3 player is in the directory D:\program and the music is in D:\music you can do this.
"../music/file.mp3"

but if the music folder is inside the program folder all you have to do is this
"music/file.mp3"

might try something like this too
car the_url:String = _root._url;
var drive:String = the_url.charAt(9); \\i dont know what the character number is. guess and check till you get the drive letter.

//then create the url based on that variable

file_url = "file:///"+drive+":\music\file.mp3";

Thank you very much for your reply!

I'll try your suggestions out, though I'm not veryskilled in this.

I have posted a more specific explanation on my project to Twall, and maybe it more clearly shows, what I lack or am doing wrongly.

Thanks again

Regards Johansen

evride
06-17-2007, 11:54 PM
ok i edited the code so it should work better.

try this

the_url= _root._url
drive = the_url.charAt(8);
loadfrom = "file:///"+drive+":/Player/st_03aB50.swf"

loadMovieNum("loadfrom", 1);

Johansen
06-18-2007, 02:32 AM
ok i edited the code so it should work better.

try this

the_url= _root._url
drive = the_url.charAt(8);
loadfrom = "file:///"+drive+":/Player/st_03aB50.swf"

loadMovieNum("loadfrom", 1);

Ok.. it now looks like this:

on (press) {
the_url= _root._url
drive = the_url.charAt(8);
loadfrom = "file:///"+drive+":/Player/st_03aB50.swf"
loadMovieNum("loadfrom", 1);
}

It still works perfectly on a copmputers D-drive, but it do not start if the drive-letter is like E or F or G

At another PC it starts in the D-drive, but not in the same computers G-drive, instead it claims, that there is no cd in the drive.:)

I hope I have put the script correctly.

Regards Johansen