Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Retreiving a Flash movie's domain name (See related posts)

Use the LocalConnection object to get the domain name of the server where the Flash movie is located.

var localDomainLC:LocalConneciton = new LocalConnection();
myDomainName = localDomainLC.domain();
trace( "My domain is " + myDomainName );



This will print out something like this:

My domain is example.com



Comments on this post

Mavrisa posts on Dec 06, 2008 at 17:54
Just a couple of notes after having tested this:
In the first instance, LocalConnection is spelled wrong, and domain is a property not a method (no parentheses needed).
var localDomainLC:LocalConnection = new LocalConnection();
myDomainName = localDomainLC.domain;
trace("My domain is " + myDomainName);


But this was EXTREMELY helpful, thank you.

You need to create an account or log in to post comments to this site.