The Actionscript Conference tickets starting at $1

The Actionscript Conference tickets are going at $1 on Ebay. Only 15 tickets to go. Go grab yours today :)

http://cgi.ebay.com.sg/ws/eBayISAPI.dll?ViewItem&item=290347825657#ht_500wt_1182

Facebook Connect in 3rd party iFrame with IE7 and below

If you are having problems trying to get Facebook to set cookies properly in IE7 and below when the site is sitting in an iframe and have a different domain with its parent container, check out this article to create a privacy policy for IE7.

http://www.softwareprojects.com/resources/programming/t-how-to-get-internet-explorer-to-use-cookies-inside-1612.html

and this fb forum thread:
http://forum.developers.facebook.com/viewtopic.php?id=452

Just tried it and FB Connect now works with 3rd party iFrame containers :)

The Actionscript Conference 2009

The Actionscript Conference is just 2 weeks away, and I’m getting more and more excited! Do check out the TAC website at http://www.tac.sg to find out more information about the conference. There are some pretty good discounts for students and NSFs so if you belong to these group of people, consider checking out the conference!

I’ll be doing a quick 30 minutes run down on Multi-touch in Flash this year, so if you are interested in these technologies, drop by and say Hi!

Cross-domain Dynamic iFrame resizing based on iFrame contents

Was facing this age old problem and googling around when I came across an excellent article at http://www.julienlecomte.net/blog/2007/11/31/ using the Yahoo cross-frame javascript library. For detailed description of how the cross-frame js works, head over to the excellent blog and read the article.

Did up a quick demo at http://www.alvinzhang.com/page.html. Simply view source, its very simple and straightforward, using a proxy as the communicator to bypass the cross-domain restrictions. Send the updated height across and set the iframe height to the new height.

Proxy and cross-frame.js can be downloaded here.

The article was written back in 2007 but still works perfectly now with the modern browsers in 2009. I would actually prefer something more familiar with flash developers like a crossdomain.xml which would be great.

Update 21 July: I just found out that HTML5 has support for cross-document messaging which makes it possible to do dynamic iframe resizing in a more elegant manner (less hack-ish).

Read: http://developer.apple.com/safari/library/documentation/AppleApplications/Conceptual/SafariJSProgTopics/Articles/Cross-documentmessaging.html

Incidentally, I came across this article while I was researching on the issue where Safari (is the only browser which) doesn’t allow an iframe containing content from an external domain to set cookies.

Post any questions in comments and I’d be glad to help out.

Fund Raising for Charmaine has reached target!

I just dropped by the blog for the above banner which is attempting to raise funds for a little girl Charmaine who is down with neuroblastoma and found out that they have managed to raised the target amount of funds which means that Charmaine will be able to fly to New York for her treatment. Cheers for that! And continue to pray for this little girl for a successful treatment.

Installing latest PHP and CentOS 5.2 for Virtualmin AMIs on Amazon EC2

If you are trying to upgrade PHP to the latest version (5.2.10 as I write this article) and MySQL and mcrypt (for the latest phpmyadmin) and you are using a server instance on EC2 running virtualmin AMI. Here is some help for the upgrade process which works for me.

Copy and paste these into terminal window
rpm -ivh http://software.virtualmin.com/bleed/centos/5/i386/virtualmin-bleed-release-1.0-1.rhel.noarch.rpm
yum upgrade php
wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm
yum install mysql-server
yum install mcrypt
yum install php-mcrypt

There might be some redundant commands up there, but its exactly what worked for me. Feel free to exclude some statements if they are not used.

iPhone and Linksys WRT54G2

If you are using iPhone to connect to the Linksys router WRT54G2 on WPA2 Personal. Make sure that the encryption scheme is TKIP+AES and not AES alone. Otherwise the iPhone will not connect. Incidentally other machines (notebooks) on the network has to reconnect to the router as well upon the new security settings.

Facebook Connect Logout not working (Wordpress FBConnect plugin)

If you are having troubles with the Logout function of Facebook Connect using the wp-fbconnect plugin for Wordpress. Head into the wp-fbconnect plugin folder, open up fbconnect.js and modify the following code (add the code in red):

logout : function() {
FB.ensureInit(function() {
FB.Connect.logout();
setTimeout(function () {
window.location = FBConnect.home_url;
}, 3000);

});
},

I have tried a couple of numbers for the delay and 3 secs seems to be rather reliable for now. You might find other numbers more suitable for yourself. I have no explanation for this behavior currently. A wild guess might be when the logout is called, there is a delay between the data being updated and synchronised across the Facebook servers, hence when the page refreshes too fast, the user is read as being still logged in and FB resets his status to being connected. If you know whats going on, please contact me via the comments below. Thanks and Cheers.

Plexiglas Endlighten

I have been crazily busy these days and have not had the time to update on my adventures in multi-touch. The rear DI table has already seen some publicity on a few occasions.
This post will briefly show the new material that I had just received which will employ the DSI technique (Diffused Surface Illumination) that uses the Plexiglas Endlighten from Evonik. I took delivery 1 week back and just got the chance to test it out. Results were awesome and solves a lot of problems inherent with Rear DI.

Here are the photos (sorry for some of the blurred photos because I took them in a rush)
Also note that the protective sticker was on the endlighten so the blobs would have been diffused and don’t appear as clear as they would have. Edges were also not polished and were rough.

PHP Session lost after header redirect

I was just working on some PHP and encountered a problem where my session was lost after doing a header redirect. After googling and doing some read up, I realised that the problem lies with using simplexml with the session variables:

For example:
$name = $simplexml -> table[0] -> name
$_SESSION["name"] = $name;

if you attempt to do a header redirect thereafter: header(”anotherpage.php”); , and try to access the session variable in anotherpage.php like

echo $_SESSION["name"];

Then an error might occur which says “Warning: session_start() [function.session-start]: Node no longer exists in …”

The solution to this problem is simple, simply cast the $name above to (string)$name so it looks like:

$name = $simplexml -> table[0] -> name
$_SESSION["name"] = (string)$name;