I want to have a swf be able to label itself. For example. If you have an FLA named "my_Movie.fla" and it publishes a movie called "my_Movie.swf", I want to be able to access that name from within the "my_Movie.swf" itself. The result for this example would be "my_Movie".
I have found a way of creating the result wanted below. But I would like to know if anyone knows a better way.
//Gets file URL
var filePathArray:Array = _url.split("/");
//Grabs file name and extention
var fileName:String = filePathArray[filePathArray.length-1];
//Finds underscores in file name and replaces them with the "_" character
var fileStringArray:Array = fileName.split("%5F");
fileName = fileStringArray;
for (n=1; n
fileName += "_"+fileStringArray[n];
fileStringArray = new Array();
//Findes dashes in file name and replaces them with the "-" character