Simple Image Cropping with Flex

Wednesday, January 6th, 2010

Here is a simple, pure as3, image cropper I wrote for Flex. I’ll try do a post later in the week describing how to use it in Flash cs3 and cs4.

[kml_flashembed publishmethod=”static” fversion=”9.0.0″ useexpressinstall=”true” replaceId=”flex_image_crop” movie=”http://www.wirelust.com/apps/flex_image_crop/bin-debug/main.swf” width=”640″ height=”458″ targetclass=”flashmovie”]

screenshot for people without flash

[/kml_flashembed]

Features:

  • Very Simple
  • Allows you to set min and max values for height and width
  • Holding shift key keeps aspect ratio

You currently have to do the cropping on your own, either in flash or server side. I will followup later with examples of how to do that.

To embed this into you application, all you have to do is:

span style="color: #ff0000;">"demo1.jpg");
	
	// imageBox is an mx:HBox in my mxml
// Set up the initial crop
 

You can then listen for CropBox.EVENT_CHANGED to get the dimensions of the box as it changes:

span style="color: #009900; font-style: italic;">// snipped ...
 

Files

 Download source code

MBTA Bus Tracker Widget for OSX

Tuesday, November 24th, 2009
mbta bus tracker icon This is a widget for showing you real-time data about bus arrival times for a chosen stop. Using Next-bus satellite data you can have a very accurate prediction of when your bus is coming.

Currently, the following 5 bus routes are supported

  • 39
  • 111
  • 114
  • 116
  • 117

screenshot of MBTA Bus Tracker Widget

download icon Download Version 1.0

Finding a good web based Excel-like grid

Wednesday, February 25th, 2009

I’ve been searching for a good Excel-like grid widget that can be embedded in web-apps. I essentially need something like Google Docs but open so I can alter and self host it.

Here is my wishlist:

  • Looks nice
  • Allows inline cell editing
  • good Javascript API or extensibility
  • can plop into an existing project without committing to a whole framework (sorry RichFaces)
  • Supports as many functions as possible, Excel functions would be nice
  • Open source (LGPL or something similar)

I looked at a ton of projects. These grids looked great for displaying data but didn’t have any support for functions so they were out. I’m putting the list here to remind myself to keep them in mind for other projects.

In the end it came down to these three projects:

Sigma Grid:

This is a nice grid for structured data and supports pretty much everything I would need for most projects. It even has chart, print, and calendar support which would make it great for end users. It supports formulas but only ones defined in the code on the page, not ones the user enters, so it wouldn’t work for this particular project.

Simple Spreadsheet

This spreadsheet appears to be the most capable Excel like clone I could find. It supports charts, formulas, and custom macros. I ended up not using this because the GUI is lacking. Out of the box my users would be forced to know some html. There also seemed to be some weird behavior when you are editing a cell with a formula in it and click on another cell. I think this would be a great project if it got a makeover and a nice user-friendly toolbar. Try it out Here.

Social Calc

I don’t remember how I found this project because their website is the least flashy and really doesn’t show much about the grid at all. Social Calc could also use some help on the GUI front, and I will have to clean it up a little before I put it in my project – but it seems to be a solid reliable control. Once you get past the UI differences from Excel — you can’t right click or select rows or columns — the editing is pretty smooth and natural. For client side formulas I would have been happy with =SUM() and =AVG() functions and was pleased to find =VLOOKUP() and most others working. In fact, it seems to support most Excel functions with the exact syntax that business guys love.
It doesn’t seem to be able to do nested formula calls. I am going to look into how difficult it would be to add that if I end up using it.

I couldn’t find a demo of Social Calc anywhere on their site. I put their demo up here if you want to try it out.