How to validate Flash absolute url paths

Bookmark and Share

You may want to dynamically change the way your flash file behaves based on where it’s hosted. To do so, you should utilize the “_url” variable to obtain the absolute path of your flash file.

Actionscript 2:
[as2]
var path = _root._url;
trace (path);
// here’s how to validate if the flash file is running locally off line.
trace (_root._url.substr(0,7));
if(_root._url.substr(0,7)==”file://”){
trace(“running offline”);
}
[/as2]

Please rate this post by clicking a star:

(No Ratings Yet)

Leave a Reply