Never been to TextSnippets 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!)

About this user

Carlos www.abismo.com.br

« Newer Snippets
Older Snippets »
3 total  XML / RSS feed 

Finding stuff in strings / or not!

Contains is an actionscript function that I use a lot. From Kirupa

contains = function (input, arrayData) {
  for (i=0; i<arrayData.length; i++) {
    if (arrayData[i] == input) {
      return 1;
    }
  }
  return -1;
};

POST and GET: Flash

Sends POST data to a webpage through flash.

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");

Random Numer

Random number function - returns a number between min and max
Receives (min, max)
Returns randomNum


function randRange(min:Number, max:Number):Number {
    var randomNum:Number = Math.floor(Math.random() * (max - min + 1)) + min;
    return randomNum;
}
« Newer Snippets
Older Snippets »
3 total  XML / RSS feed