Convert string to TitleCase in Flash using ActionScript function

Unfortunately and surprisingly, Flash AS3 does not have a TitleCase function a la ucwords() in PHP todate. Following ActionScript 3.0 function will let you do just that: function titleCase(txt:String):String{ txt = txt.split(" ").map(function(myElement:String, myIndex:int, myArr:Array):String{ return myElement.substr(0, 1).toLocaleUpperCase() + myElement.substr(1); }).join(" "); return txt; } // you’ll use this function like this var heading:String =…

[Nokia N900 X Terminal] cp: How to fix Omitting Directory, Permissions Denied Linux Command Errors

While updating few files in a game on Nokia N900 using X-Terminal, files did not copy when I used cp command, it gave ‘omitting directory’ error. FIrst of all gain root access by typing following command: ~$ sudo gainroot ~$ cd MyDocs ~/MyDocs $ cp directory-name /opt/application-name/ cp omitting directory ‘directory-name’ You can fix it…

[AS3] Dynamically adding styles to TextField Component with TextFormat class in Flash using ActionScript

In AS3, styling the text content dynamically is done using TextFormat class. Create a new Flash AS3 file, In the ActionPanelCreate a TextFormat object with the specified properties. You can then change the properties of the TextFormat object to change the formatting of text fields. For making TextField Bold var boldText:TextFormat = new TextFormat(); boldText.bold…