Get your Flash Movie's URL
myUrl = getProperty("", _url );
TextSnippets > danb > flash
1807 users tagging and storing useful source code snippets
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!)
Dan Berlyoung
myUrl = getProperty("", _url );
function explode(separator:String, string:String) { var list = new Array(); if (separator == null) return false; if (string == null) return false; var currentStringPosition = 0; while (currentStringPosition<string.length) { var nextIndex = string.indexOf(separator, currentStringPosition); if (nextIndex == -1) break; var word = string.slice(currentStringPosition, nextIndex); list.push(word); currentStringPosition = nextIndex+1; } if (list.length<1) { list.push(string); } else { list.push(string.slice(currentStringPosition, string.length)); } return list; }
// // recursive function to print out the contents of an array similar to the PHP print_r() funciton // function print_a( obj, indent ) { if (indent == null) indent = ""; var out = ""; for ( item in obj ) { if (typeof( obj[item] ) == "object" ) out += indent+"[" + item + "] => Object\n"; else out += indent+"[" + item + "] => " + obj[item]+"\n"; out += print_a( obj[item], indent+" " ); } return out; } // example call trace( print_a( example_array ) );
function collapseWhiteSpace( theString ) { theString = theString.split("\r").join(""); theString = theString.split("\t").join(""); while ( theString.indexOf(" " ) != -1 ) { theString= theString.split(" ").join(" "); } if (theString.substr(0,1) == " ") { theString = theString.substr( 1 ); } if (theString.substr( theString.length-1, 1 ) == " ") { theString = theString.substr( 0, theString.length - 1 ); } return( theString ); }
var localDomainLC:LocalConneciton = new LocalConnection(); myDomainName = localDomainLC.domain(); trace( "My domain is " + myDomainName );
My domain is example.com