iGetIt! Music

Online music education courseware for non-musicians who want to learn how to write their own rock songs.

My Photo
Name: Jim Plamondon
Location: Austin, Texas, United States

This blog documents the development of JIMS iGetIt! Music System (JIMS). JIMS' goal is to help you Understand Music in 24 Hours™, if you are (a) a non-musician (b) who wants to learn how to write your own rock songs. Requiring no instrument other than your own computer, and without using traditional notation, JIMS is being designed to deliver a deep understanding of tonal structure...in just 24 hours.

Friday, December 11, 2009

States in Flex 4

One way to architect the code for a "lesson" is as a series of states. Flex 4 (now in beta) has improved its support for states, so this seems like a reasonable approach to explore.

Here's a program that demonstrates a trivial use of states in Flex 4 Beta 2 (source code here):

A ButtonBar at the bottom is initialized with the names of each of three states, and a label reflects the name of the currently-selected state. When the ButtonBar is clicked, the state is changed. Whenever a new state is entered, a short narration is played.

To use this approach in my courseware, I'll need to break each lesson up into a series of states, and define the actions to be taken whenever a new state is entered. Flex 4's new-and-more-general animation model should make it easier to define these actions than was previously the case.

I have no idea whether this is the "best practice" way to architect interactive courseware in Flex. I'm kinda flying blind here. Suggestions welcome.

[Postscript: All three ButtonBar-buttons display properly in Safari on my Mac, but the rightmost part of the StateTest1 widget, including most of the third ButtonBar button, is clipped off in Internet Explorer on my Windows machine.  I don't know why.  Welcome to the joys of cross-browser incompatibility, I guess.]

Labels: ,

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home