This content has been marked as final. Show 3 replies
> Hello. I was wondering if it's possible to read a part of a URL
> with ActionScript...
It is. :) Read the MovieClip._url property from the main timeline (the
main timeline is a movie clip), or the LoaderInfo.url property of the main
timeline's loaderInfo property ... if you're using ActionScript 3.0.
// in a pre-ActionScript 3.0 main timeline ...
// in an ActionnScript 3.0 main timeline ...
That will show you the domain name of the HTML file that contains the
SWF you're in, and you can use String methods, such as indexOf() to see if
the URL contains ".com", "co.uk", or the like. If you're using ActionScript
3.0, you can use regular expressions (see the RegExp class).
Co-author, Foundation Flash CS3 for Designers
"Luck is the residue of good design."