Archive for February, 2009

Flex Effects Explorer

I came across the efflex.org. Its so amazing.. someone took effort to make such library.. I compiled a zip with required Lib elements on this link efflex.

Advertisements

AS3 : Basic String function

Some Basic String functions:

public function replaceChars(str:String, Char:String, replace:String) : String
{
var result:String = “”;
for (var i:int = 0; i < str.length; i++) {
if (str.charAt(i) == Char)
{
result += replace;
}
else
{
result += str.charAt(i)
}
}
return result;
}

public function trimWhiteSpace(str:String) : String
{
var pattern:RegExp = /[\s]+/g;
return str.replace(pattern, “”);
}

public function containsAlphaNumeric(str:String) : Boolean
{
var pattern:RegExp = /[^a-zA-Z0-9]/;
return str.search(pattern) != 0;
}