JavaScript Promises A+ “Anytime, Anywhere”

Screen Shot 2015-01-15 at 5.54.49 PM

Like Vasquez says: “Anytime, Anywhere”

tl;dr: here is the codepen

Expect all network communication to be asynchronous. You don’t know when requests will come back to you, and you likely have no idea what order they will arrive back. So you write your code asynchronously, same as you do in real life:

“Look, just get back to me when it’s done, ok?”

“Sure thing, I’ll call when it’s ready”

That’s all a Promise is – that conversation and that commitment. And they are a great design pattern to restore some sanity to asynchronous code.

Continue reading

The Software Event Model

This article by Ruben is a nice, jargon-free explanation of the AS3 event model, which applies to other languages in concept if not in syntax. It’s worth getting a handle on this powerful tool and also to keep in mind that it is not the only way to send signals between loosely couple objects in a software project. In fact the Signals and Slots methods used in other platforms such as Qt are very useful extensions of the event model. John Lindquist has a video tutorial using the AS3-Signals library for AS3 here. There is also Senocular’s post on the technical details of using the Event Model to handle how an event moves through you application

Flash and 3D – Hardware Acceleration is almost here

There is hardware acceleration in flash now, however it is not 3D, but rather 2(.5ish)D, and the CPU is left doing the real 3D geometry calculations while the graphics hardware does 2D rendering chores like texture mapping – and essentially idling. This results in 3D performance maxing out at the 1000’s of triangles per frame, far behind leading edge.

Adobe is remding this though in a near-term release of Flashplayer and to provide access to this new capability, the Molehill 3D API has been introduced. Adobe has provided an overview of the API and the results are simply a hundred-fold inprovement in 3D performance. This should make the Flashplayer version of Moore pleased. Oh and the best part? Adobe is collaborating with the 3D engine developers to get the tech into your favorite frameworks, like Away3D. Now if only it was 2007 and not 2011.

Grant Skinner’s Easle for HTML5 Canvas

Moving between Flash and the Canvas object requires a bit of retro 1990’s thinking: Canvas does not have some of the productivity features that Flash has, like Objects and updates – it feels a bit like doing everything in flash using only bitmap objects. Grant and his team have put together a utility that adds this Flash- like functionality: EasleJS. Check it out and let me know how it works for you!