Hi all,
Does anyone one know if it’s possible to have AS take the filename of itself and make it a variable. I need it to be done by AS only. I know it’s possible in PHP, but I’m not sure about AS.
I’m guessing if it’s possible it’s one line of code.
I’m using Flash 8 but publishing at Flash 6, AS 2.
Thanks in advance,
Bret
maybe I’m explaning this poorly… here’s some code that outlines what I’m trying to do.
var filename = [here is where I need help];
trace (filename);
i have a file with this code in it, the filename is ‘test.swf’. when i test this movie i want it to output ‘test.swf’ in the output window.
basic operation, but i don’t know how to pull it off.
anyone?
I’ve found a way. If anyone is interested…
function getFileName(fileUrl) {
var fileName = fileUrl.substr(fileUrl.lastIndexOf("/") + 1,
fileUrl.length);
return unescape(fileName);
}
trace (this.getFileName(this._url));