— Shang Liang

Developing iPhone stuff with Cocoa, Objective-C and xCode? Take a look at www.vikingsmackdown.com. If you don’t have an iPhone, you can view the video in this article from TechChurch.

I thought it was built with the accelerometer and stuff but it was just JavaScript! It listens to a Safari browser event, “onorientationchange”. So technically, it’s not motion sensing. It’s a very old JavaScript event “onresize”. All other phones with a rotatable browser can also implement this diea.

More information of developing JavaScript based applications or games can be found at Apple Web Apps DevCenter.

Read More
  1. Cloaking. It’s too easy to cloak with swf files: off-stage text, transparent/invisible text, text on the stage but users can never reach or use ActionScript to hide text.
  2. Bad user experience. When a user clicks at a swf link in search results, the swf file will be opened ‘nakedly’ in the browser, filling up the full browser. If the swf file is meant to be shown in full browser, it’s not much a problem. However, most of swf files are meant to be shown in a specific dimension and they will scale up and get pixelated in this case.
  3. Broken link. Following from point 2, if the swf file is directly opened in a browser, some swf files can not run properly. Some files require communication with JavaScript and some need the data set by flashvars (in embed tag) or addParameters (in swfobject).
  4. Cloak to solve the problem. Problem 2 and 3 can be solved with some detection codes. If the swf file detects that it’s ‘naked’, without a HTML holder, it can automatically refresh to the HTML page.  However, the problem is that you are cloaking.
  5. Inaccurate link. A swf link from a search engine doesn’t directly bring the user to the information he/she is searching for, in most cases. It’s very unlikely that when a user searches for “curry chicken” and the linked swf file has “curry chicken” is in the landing screen. Most likely, the user needs to click around to look for the content again. On top of that, Flash does not support full page text search and of cause, search engine can’t highlight the search words either.

Read More

I’ve made this little AIR application to generate asdoc commands. It’s in BETA 2 now. Not sure whether I should work on it further more because I’d like to keep it simple. The project is hosted here. Please help to report any bugs/issues at the issues page.

Read More

To avoid HongKong, Taiwan and China’s “one China” policy problem, do not mention the word “country” in your *uhem* drop down menu. Use something like, “location”, “where do you live?” and “your region” etc.

Read More

If you list China, Hong Kong and Taiwan as 3 different countries, you’ll get complained by Chinese.

I seriously feel that at the current moment all Chinese should spend more energy cleaning up Beijing streets other than hunting down companies who list countries wrongly.

BTW, I think website domains should change, too. .com.hk is wrong. It should be .com.cn.hk

Read More

3d

Inspired by this blog entry: http://impossiblearts.com/blog/2008/05/06/bernhard-kerschbaumer-3d-portfolio-reel/

I was trying very hard to find Papervision’s traces but couldn’t then I realised this is a portfolio of a 3d guy not a 3d portfolio. 

Read More

In Papervision3D, all classes that extend DisplayObject3D inherit its lookAt function. But the problem is the result of A.lookAt(B) sometimes ends up as A back facing B. This problem is more obvious when you want to rotate a plane to face the camera. The plane becomes invisible because it’s back facing the camera. If you set the material to double-sided, the material is mirrored which is not acceptable in some cases.

To work around the problem without touching 3D rotations, you can create an empty object3D as C and place it along vector BA and call A.lookAt(C). Vector BA can be calculated as {A.x-B.x, A.y-B.y, A.z-B.z} and the position for C should be {BA.x*1.1+A.x, BA.y*1.1+A.y, BA.z*1.1+A.z}. The number 1.1 is just an arbitrary number. Any number greater than 1 will do the trick.

I’ve done this piece of ugly thing as a demonstration and the source is here.

Read More

>>Enjoy<<
>>Source<<

Read More

Recently, my hatred against Flash websites (and other non-HTML websites, Silverlight in this case) came back. I know I shouldn’t blame the platform, rather I should blame the users.

http://www.microsoft.com/windowsserver2008/en/us/serverunleashed/default.html

Why is this website in Flash? Why is there a robot? Yes, geeks like robots but they are not 5 year old kids. An acrobatic robot won’t convince them the OS is good. A simple HTML page with big tables and numbers is a lot more erotic.

Read More

I’ve made this little AIR application to generate asdoc commands. It’s in BETA 2 now. Not sure whether I should work on it further more because I’d like to keep it simple. The project is hosted here. Please help to report any bugs/issues at the issues page.

Read More