1 person found this helpful
you can use:
Ok... can't believe it was that simple. That's a little embarrassing. Thanks so much
That's pretty neat. What I'm trying to do with this is create a simple "next" function whereby a next button is clicked and the function does:
get the swf name, add 1 to that number and load that swf.
So, I will have say, 12 files numbered 1.swf, 2.swf etc to 12.swf.
I'd like the actionscript to get the name convert it to a number, add 1 to that number and then load the file.
This is just to avoid having to change each individual script in each loaded swf also so that if a user enters the portfolio anywhere within the portfolio, the next function will pick up where it is at.
But, I can't find in the documentation of Strings, how to get that number as a number rather than a string.
if your swfs are in the same folder, you can use:
var urlS:String = this._url;
var n:Number = Number(urlS.substr(1+urlS.lastIndexOf("/")).split("."));