Unhappy with Flash CS4Why “z” is not the shortcut key for zoom any more? There’s no “z” in “Bind Tool” but why it’s configured this way? I thought Adobe is trying to standardize all shortcut keys across all its software? Why the help page is online? After I managed to set the help offline, I realized they took out Actionscript 2 references. Fuck you whoever made these decisions! |
Algorithm for adding leading zerosI’ve always been writing this.
function addZero(n:int):String {
if (n < 10) {
return "0" + n;
}else {
return "" + n;
}
}
The function adds one leading 0 quite well but if two 0 is needed, it's quite bad to write all the conditions to check whether it's less than 100 or 10. I think the following code is more efficient.
function addZero(n:int, numZeros:int = 1):String {
var str:String = n + "";
while (str.length<numZeros+1)
{
str = "0" + str;
}
return str;
}
|
A new trick to make pixel fonts clear in FlashPixel fonts tend to get blur in Flash. Most of the time the problem can be solved by setting the textfield’s coordinates (x,y) into integers but sometimes it fails to work. I’ve found a new trick to solve this problem. If you check the option of the textfield to be selectable, the texts appear clear no matter what their x and y are. |
Glyphs Helper – A small tool to extract unique glyphs from textUseful for Flash users and more useful for Flex users to geenerate the glyph ranges. Built with JavaScript. |
Mouse Hunt on your mobile phones!I’m recently addicted to Mouse Hunt, a fantastic game on Facebook. However, it’s too hard to play on any mobile phone. The page is too big to be displayed on mobile phones and it takes quite a while to load. Trying to be useful, I wrote some PHP scripts to help with the situation. It serves as the middle man, communicating with Facebook and displaying minimal information to the user. It’s not a full mobile version of the game. Enjoy the game on the run now! http://www.shang-liang.com/mh |
Whitenoise Generator – Something helps to sleepJust something really random and stupid, but I think it may be useful. Sometimes it’s too quiet and your ear has the “ying ying ying” sound. It’s quite annoying. This small file generates white noise. Built in Processing and Minim library. |
Trying PureMVC for website navigationI was always wondering how to use PureMVC for website development. Today, I’ve finally got a chance to try it. I’ve read the documents many times but never really understand it so clearly after this small hands on practice. The example is the most typical scenario, some clickable buttons on the stage and click at one button will show the corresponding content. |
Not enough disk space to install flash player 10 problemIf your computer doesn’t have a C: drive, flash player 10 installer for firefox won’t be able to run properly. It keeps giving not enough disk space error. After Googling for a while, I found the solution in Yahoo answers.
* The method that uses a USB drive didn’t work for me. My system drive is named as “W”, stands for Windows. I’m weird, I know. It’s such a low level bug and it’s really unaccetable. I’ve installed tons of stuff in my computer and had never encounter this kind of problem before. |
Understanding Website Analytics DataI’ve recently finished a project. It’s a website for a wedding gown boutique. The main function of the website is to show their products, just like a of photo gallery. There are loads of photos and I tracked every photo’s page view. While I was happily looking through the numbers in Google analytics I realise the page view duration is a very good indication of how good or popular the product is. People will stare at a photo longer if they like it and if they don’t like it they’ll quickly click at the next button. I feel this is very useful information to engage the customers’ taste. UPDATE: as @ickydime mentioned, the tracking data is not 100% accurate. There are cases that users leave the window open, go to do something else and come back to their desks again, recording a very long page view duration. And there are also users accidentally closed the page, clicked away or some other stuff, which record very short page view duration. But all these inaccuracy will be minimised when more data is collected, the errors will be averaged with a big base. Based on the tracking data, no exact figure can be given, such as 53.4% users like product A. But the data can definitely tell that a product with average 30 seconds page view duration is more popular than a product with average 5 seconds page view duration. |
