Get your Flash Movie's URL
This function returns the full URL of the .swf file. Simple enough.
myUrl = getProperty("", _url );
2819 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!)
myUrl = getProperty("", _url );
contains = function (input, arrayData) { for (i=0; i<arrayData.length; i++) { if (arrayData[i] == input) { return 1; } } return -1; };
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 my_Var:LoadVars = new LoadVars(); my_Var.Variavel1 = Variavel1_txt.text; my_Var.Variavel2 = Variavel2_txt.text; /*"_self" specifies the current frame in the current window. "_blank" specifies a new window. "_parent" specifies the parent of the current frame. "_top" specifies the top-level frame in the current window. */ my_Var.send("URL_stays_here", "_blank", "POST");
this["whatever"+i]._x //or root["whatever"+i]._x
function randRange(min:Number, max:Number):Number { var randomNum:Number = Math.floor(Math.random() * (max - min + 1)) + min; return randomNum; }
countDown = function() { seconds_conta = seconds_conta - 1; hours = int(seconds_conta / 3600); minutes = int((seconds_conta / 60) - (hours * 60)); //seconds = int(seconds_conta-((hours*3600)+minutes*60)); seconds = int((seconds_conta % 60)); //Se for menor que dez, acrescenta um zero if(minutes<10){ minutes="0"+minutes; } if(seconds<10){ seconds="0"+seconds; } //Será que precisa colocar no frame correto? timer_txt.text=(hours+":"+minutes+":"+seconds); //trace("seconds_conta: "+seconds_conta); //trace("hours: "+hours); //trace("minutes: "+minutes); //trace("seconds: "+seconds); if (seconds_conta == 0) { clearInterval(timer); //Chama função de acabar a contagem! //fim_das_questões(); } } ///////// Acrescentar no código //Tempo total inicial em segundos ->Calculado a partir da quantidade de questões seconds_conta = 185; ///////// Inicia o timer //A cada 1000 ms, ativa a função countDown, diminuindo um segundo do total timer = setInterval(countDown, 1000);
<method name='checkServerResponse'> <![CDATA[<![CDATA[ var loadobj = new LoadVars(); loadobj.onData = this.checkServerResponseHandler; var reqstr = LzBrowser.toAbsoluteURL( "__dbgprobe.lzx?lzt=stat", false ); loadobj.sendAndLoad(reqstr , loadobj, "POST" ); ]> method><![CDATA[<![CDATA[ // NB: This is a callback handler, and 'this' will be bound to some LoadVars object, not to Debug if (src == undefined) { Debug.freshLine(); Debug.addHTMLText('<font color="#FF8800">Debugger cannot contact LPS server, switching to SOLO mode.</font>\n'); Debug.setAttribute('solo_mode', true); } ]> method>
function testMe() { trace("callback: "+getTimer()+" ms."); } var intervalID:Number = setTimeout(testMe, 1000); // clearTimeout(intervalID) // for clear the timeout
var myMC:MovieClip; var i = 1; var pad = 5; while (i<6) { trace(" i : "+i); myMC.duplicateMovieClip("myMC"+i, i); myMC.removeMovieClip(); this["myMC"+i]._x = this["myMC"+(i-1)]._x+(this["myMC"+(i-1)]._width)+pad; this["myMC"+i].onRollOver = function() { trace(this); }; i++; }
var localDomainLC:LocalConneciton = new LocalConnection(); myDomainName = localDomainLC.domain(); trace( "My domain is " + myDomainName );
My domain is example.com
var oImgListener = new Object(); oImgListener.onLoadInit = function(target_mc) { trace(target_mc._name + " load complete"); ... } var mclImg = new MovieClipLoader(); mclImg.addListener(oImgListener); mclImg.loadClip("http://myurl.com/path/to/swf/or/jpg", mcImgLoader);