title: javascript callback issue
body: <p>I don't really understand how callbacks work. Here is the code (line 49-53 is where the problem is, I want n to be equal to the number of images in my directory): <a href="http://pastebin.com/HbALuzGE" rel="nofollow">http://pastebin.com/HbALuzGE</a>. I expect onerror callback to happen immediately (as play() calls change() which uses my n var), but that's not the case, yet I don't know how to correct it.</p>