Posted by Jacob Wright in ActionScript 3, Flash, ReflexFeb 17th, 2010 | 4 Comments
Monday I wrote about how I would use the observer pattern to alter the functionality of getters/setters and respond to changes without using Flash's events. Tyler and I brainstormed more about the solution and as I knew would happen we came up with a better implementation.
Changes
One thing I didn't like about my initial go at it, is that you had to create a class with three methods, and usually you only used one of them. So methods were being called that didn't need to be for the sake of it. We decided to add functions on an as-needed basis. I named the different types checks, hooks, and observers.
Check,...
Posted by Jacob Wright in ActionScript 3, Flash, ReflexFeb 8th, 2010 | 6 Comments
I've been trying to figure out the best way to include a styling framework with Reflex as needed, without requiring APIs and including extra classes in the core. Pay-as-you-go. The solution that I finally came up with turns out to be great for not only styling, but effects/transitions and data-binding too. I'll start with data-binding to try and describe the benefit.
Flex Data-binding
In Flex we have data-binding. Data-binding is cool. Allows us to do stuff a lot easier. We use it in almost everything we write in Flex.
Unfortunately, data-binding is based on the event dispatching system in Flex....
Posted by Jacob Wright in ActionScript 3, Flash, JavascriptNov 28th, 2009 | 5 Comments
So there may not be an exorbitant amount of use-cases for displaying an image in HTML that was generated real-time in Flash, but I thought's cool, so I'm sharing anyway. It makes the inner-geek in me smile.
Short background: I was looking into creating a Flash drawing app that consisted only of the canvas portion, with the rest of the UI in HTML. This is for many reasons including the size of Flex, the native OS components in the browser, speed, and hey, it forces separation of core app logic from the presentation logic, right? ;)
So I wanted a way to display thumbnails of the pages of my drawing....
Posted by Jacob Wright in ActionScript 3, Flash, PHPNov 16th, 2009 | 16 Comments
After building a couple of RESTful services using the Zend Framework, I decided to create a dead simple REST server that allowed me to skip all the features I didn't need as well as a tons of classes that came with Zend Framework MVC. There are still useful features to add (XML support for example), but overall I'm quite happy with what I've come up with.
My solution, RestServer, is a JSON REST server, so far. It should be trivial to add support for XML or other formats, but there would have to be assumptions on what your object would look like in XML (XML-RPC style, your own custom XML format,...
Posted by Jacob Wright in ActionScript 3, FlashAug 24th, 2009 | 6 Comments
Earlier I posted about the Response Pattern. Today I wanted to show an ActionScript implementation and how it would be used.
The API I decided to go with for this pattern uses method chaining. This is one of those things where people love it or they despise it. I'm sorry if you are one of the latter. Method chaining is where an object returns a reference to itself as the result of its methods. This allows you to call many methods on the object in one line. jQuery uses this and it is used a lot in the Zend Framework. As example you might have a drawing API helper that does this:
shape.fill(0x660000).rect(0,...
Posted by Jacob Wright in ActionScript 3, Flash, FlexJul 17th, 2009 | 20 Comments

Ever need a thumbnail of an image in Flash? I do, and honestly speaking, the resampling that Flash does is less than ideal. Unless you only need to resize by half or bigger. But my thumbnails usually need to be smaller.
I searched for a solution and found on voq.com a promising library with some algorithms that worked quite nicely and a demo. The quality was nice, but the speed was slow. It also fiddled with the color a little bit. If I put the "easyScaling" parameter down from .5 to .25 I ended up with a nicer thumbnail but was slower to make and had more color disfiguration. You could tell what...