NOTE: Sadly I am no longer updating this blog. You can go to my homepage instead.
Jun 30 2008

AS3 | Flex | Programming

Scaling a DisplayObject to fit to a container’s dimensions

I’ve often run into the problem of proportionally scaling an image (or other DisplayObject) to the dimensions of its parent container. I always end up having to scavenge around in my code bank for the line of code to do this—which really is a simple bit of code—but I prefer to copy-and-paste it than rewrite [...]

Read the rest of this entry...
May 14 2008

AS3 | Flex

Transformational Canvas v1.0

I wanted to create a Flex Canvas-based component that acted like a camera looking down on a tabletop containing objects. Any item added to the canvas would automatically be able to be dragged as a group and individually, while the whole view could be zoomed and rotated. Here is the result:   This movie requires Flash [...]

Read the rest of this entry...
May 07 2008

AS3 | Flex | Programming

Encapsulating interactive behavior in Flex applications for better code readability

Consider for a moment dragging an element within an application. The steps required for this operation are as follows: Behavior Description Event to listen for START DRAGGING… When the mouse button is pressed down over the element. MouseEvent.MOUSE_DOWN DRAG… While the mouse is moving and the mouse button is pressed down over the element. MouseEvent.MOUSE_MOVE [...]

Read the rest of this entry...