Flex Revisited: Energy Awareness

Filed under:Programming — posted by jeremycoulson on December 19, 2009 @ 4:37 pm

An employee committee at work has been tasked with finding ways for the County to save energy costs internally. Part of this effort involves employee education about energy awareness. A member of this committee approached me about adding this educational program to the employee intranet with information to read and then a test to reinforce what the employee just read.

I’m not totally sure why it struck me to do this, but the test seemed like an opportunity to further explore what I can do with Flex beyond the five-question Beowulf quiz I made a while back. So far, I have made lots of progress and have felt my brain thanking me for stepping out of Visual Studio and C#.NET for a while.

Since we don’t have money at work for a copy of Flex Builder and I like the assistance of an IDE that can do things like code-completion and compilation with a simple keystroke, I decided to use the open-source product called FlashDevelop. Oh, it’s not as fancy as Flex Builder, but at free it’s $250 cheaper and will be fine for me.

First, I created an experimental MXML file just to see if I could learn how to do the main things required by the test: ask a question, get an answer, check the answer, and record that test result in some sort of database or text file. To my surprise (because I’m usually surprised when I get something right), I was successful. My experimental Flex application sets some variables to the input and uses an httpservice to send the data with URL parameters. A tiny C# app I wrote at the receiving end of that URL gets those parameters, sets variables to them, and writes them to a tab-delimited text file. I chose tab-delimited text file because the guy getting the results of the tests will never need anything more complex than that.

With that under my belt, this week I started to write the actual Flex application for the test. As of Friday, my test was asking questions, storing input, checking answers, awarding points, validating for null checkboxes, displaying a “Submit your score” box, and basically doing everything except using the httpservice to send the scores along to the text file. That will come after I am given the rest of the questions for the test.

I’ve enjoyed exploring a new programming environment and have been pretty happy with my ability to make things work correctly. Once the education and test portion of the energy awareness program is published, there is an accountability portion I will be working on.  I’m already pretty certain I’ll be using some Flex there, too.

When the education and test are ready, I’ll post a link for those interested in how it turns out.

2 comments »

  1. good for you, FLEX is really cool and definitely catching on…even more so than last year.

    The flash requirement(s) though will always limit it more so than straight up AJAX though. But you can probably learn JQuery easily…

    Comment by J-Sin — January 9, 2010 @ 3:31 pm

  2. Actually, I use jQuery a tad at work, but not as much as I could!

    This is an intranet application. I’d be less enthusiastic about using Flash for a public-facing website; however, there’s a chance the GIS department may use Flex to build their new interatcive mapping site.

    Comment by Jeremy — January 9, 2010 @ 3:46 pm

Copy link for RSS feed for comments on this post or for TrackBack URI

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

(required)

(required)




image: detail of installation by Bronwyn Lace