-
strip .swf extension from display
I've made a simple mp3 player that draws external swf's from an array, there is a dynamic text area (title)that displays the name of the file that is playing.
code:
on (release) {
if (count == undefined) count = 0;
{
_level1.unloadMovie(); // stop loading old stream
loadMovieNum(urls[count],1); // load new song into level1
title.text = urls[count];
playing.text = "now playing:";
}
}
Is it possible to strip the .swf extension so that it just displays the filename?
Thanks.
-
yes:
string.substring(0, string.length-4)
-
thanks but how do i implement that into my code?
-
Untitled-1.fla
code:
title.text = urls[count].substring(0, urls[count].length-4);
-
my_string = "hello.swf";
//my_string = urls[count];
mynew_string = my_string.substring(0, my_string.length-4);
trace(mynew_string);
//title.text = mynew_string;
-
thanks a lot, works a treat, anyone know why the actionscript tags arent working??
-
Nope! They just stopped working. Use [ code][ /code] tags instead!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|