Archive for October 2008
Removing whitespace characters from String
var str:String=” 123456789 “;
Trace(str.length); //15
Trace(StringUtil.trim(str).length); //9
StringUtil.trim method removes all whitespace characters from the beginning and end of the specified string.
The StringUtil utility class has some more methods that will be more useful when you work with String objects within Flex:-)
Detect the Installed Flash Player Version
Alert.show(“You are using flash version”+flash.system.capabilities.version.tostring());
this will give you the Flash Player Version installed in your system:-)
Hiding Windows Default Cursor
Mouse.hide()—–use this method when ever you want to hide windows default cursor
Mouse.show()—-use this method to display the hidded windows default cursor
These methods are commonly used when user mouseover any video player,where we can hide the default window cursor:-)
Setting handCursor
<mx:Label text=”change cursor” useHandCursor=”true” mouseChildren=”false” buttonMode=”true”/>
same property can be applied for setting handcursor in canvas,button..