Posted by vipuljhawar on August 10, 2007
List of some additional functions i have written for the flex project. Will keep on updating my api, regularly with reusable functions.
/** Determines if a string is upper case */ public function isUpperCase(value : String) : Boolean {
return isValidCode(value, 65, 90);
}
/** Determines if a string is lower case */
public function isLowerCase(value : String) : Boolean {
return isValidCode(value, 97, 122);
}
/** Determines if a string is digit */
private function isDigit(value : String) : Boolean {
return isValidCode(value, 48, 57);
}
/** Determines if a string is letter */
public function isLetter(value : String) : Boolean {
return (isLowerCase(value) || isUpperCase(value));
}
/** The meat of the functions which checks the values */
private function isValidCode(value : String, minCode : Number, maxCode : Number) : Boolean {
if ((value == null) || (StringUtil.trim(value).length < 1))
return false;
for (var i : int=value.length-1;i >= 0; i--) {
var code : Number = value.charCodeAt(i);
if ((code < minCode) || (code > maxCode))
return false;
}
return true;
}
Posted in Flex, Useful flex api | Leave a Comment »
Posted by vipuljhawar on August 10, 2007
It’s been some time since i have been writing code for displaying trees for different modules in my project. A tree is a very useful component as it its fast to navigate, hierarchical, can be sorted, expands/collapses so requires less space and what not. Over this period of time i have come across some code snippets which may definitely prove to be useful for any Flex developer working with trees. Let me kick them one by one.
Expanding the complete tree from the root node and select a particular node – This is one of the common requirements and can be easily established by using the following snippet. Once you have done whatever you want to do with the tree just put a call to the function -
/**
expandTree - is a function which will expand the root node
[newNode] - is an array of arguments which will be passed to the expandTree().
*/
callLater(expandTree, [newNode]);
A sample expandTree function is -
private function expandTree(childNode : Object) : void {
treeID.expandChildrenOf(treeID.getChildAt(0), true); treeID.selectedItem = childNode;
}
The assignment of expandTree to callLater sets the data provider properly and then trigger a call for expanding the tree.
Posted in Flex, Flex Tree control | Leave a Comment »
Posted by vipuljhawar on August 10, 2007
Exponential has released a Free Adserver for publishers. Backed by one of the best Ad Networks – Tribal Fusion, Expo9 will provide great services to publishers. Gotta look at the Ad Server interface, worth a watch.
http://www.exponential.com/news-events/no-cost-ad-serving-solution.jsp
http://venturebeat.com/2007/06/20/expo9-another-free-ad-server-for-online-publishers/

A very feature rich Ad Server.

Posted in Uncategorized | Tagged: Ad Network, Adserver, Online Advertising, Publishers | Leave a Comment »