FORUMS: list search recent posts

Can a Flash movie read it's own filename?

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
iomega_zippy
Can a Flash movie read it's own filename?
on May 30, 2007 at 5:51:14 pm

Can a Flash movie read it's own filename? I am looking at using such functionality in helping to automate, so it pulls in, say, an XML file of the same name, just a different extension...

Thanks!



Return to posts index

Donnolio
Re: Can a Flash movie read it's own filename?
on May 31, 2007 at 5:48:14 pm

_root._url



Return to posts index

iomega_zippy
Re: Can a Flash movie read it's own filename?
on May 31, 2007 at 6:32:04 pm

Donnolio,

That worked GREAT! Thanks!

Here is the code that I made...

----------------------------

var whereIsIt:String = this._url;
trace("Location: " + whereIsIt);
var lastSlash:Number = whereIsIt.lastIndexOf("/");
var lastDot:Number = whereIsIt.lastIndexOf(".");
trace("Character Number of last slash: " + lastSlash);
trace("Character Number of last dot: " + lastDot);
var nameLength:Number = (lastDot - lastSlash) - 1;
var filename:String = whereIsIt.substr(lastSlash + 1, nameLength);
trace("Filename: " + filename);

----------------------------


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]