Topic: ChumbyDevelop

After some tweaking and testing I finally got some usable environment for developing Chumby applications using FlashDevelop.
I create a basic template and a couple of applications built with the template. You can download it from here:
http://www.aromatic.org/chumby/ChumbyDevelop.zip. There is a readme file that explains how to use it but basically it's this:

Chumby application template for FlashDevelop
--------------------------------------------

To create applications for the Chumby using FlashDevelop follow these steps:

- install FlashDevelop from http://www.flashdevelop.org/community/
  Note: I had problem with the 2.0 Release Canditate 3 and reverted to 2.0 Beta 9
 
- install the Chumby project template:
  Copy the folder "05 Chumby Project" in the FlashDevelop template folder.
  For beta 9 is c:/Program Files/FlashDevelop/templates. For RC3 the folder has been moved into some other folder.
 
- Start FlashDevelop and create a new Project (from the toolbar: Project/New Project)
  Select "Chumby Project" from the list of installed templates, give it a name and create the new project.
 
Done! Compile and test and you should have a basic app going. Add more code and enjoy!


What it does:

- the template creates a scheleton application for a Flash 7 movie, 320x240 pixels, 12 FPS.
  It also creates:
  - a main application class (ChumbyApp) where you can add your code
  - a Util class with a couple of useful methods and constants
  - a Menu class, to create a very basic list menu where entries are selected on click.

- the template also contains a font that can be embedded in your app.
  The font is called "Monofonto" and I got it from here: http://www.1001fonts.com/font_details.html?font_id=2240
  Many thanks to the author.
  Look at the samples classes to find how to use the font and read the FlashDevelop documentation.
  The main thing to remember is to set the "embedded" property to true on the TextField (to embeds the characters
  in your SWF) and to use the TextField.setNewTextFormat() method instead of setTextFormat() if you are using
  dynamic text (i.e. if you are updating the text in the TextField).
 
What else is there:

I have added a couple of very simple apps generated with FlashDevelop and a super-basic "Chumby shell" to test
nested movies. You can copy them in your FlashDevelop main project folder (usually "My Documents/FlashDevelop").

- Chumby Shell: a very basic movie loader. It loads your favorite chumby app in the middle of the chumby skin.
  Note that you need to set the path to your Chumby app in the code (one day I'll add a dialog or something).
  Flash lets you pass parameters to your app also for local files so you can change the path to your movie to,
  for example "Chumby Vars.swf?hello=there". This will add a variable named "hello" with value "there" to the
  "Chumby Vars.swf" root movie.
 
- Chumby Vars: display the variables associated to the app root movie. If you load this in Chumby Shell and
  pass some extra variable as explained before you should see them added to the list.
 
- Chumby Menu: a sample usage of the Menu class. Entries are selected when clicked (or tapped on a Chumby).
  For now it only prints some debug messages when selecting an entry. One day I'll add a user defined callback.
 
Notes:

Flash is strange, that's all I can say! I still don't understand the Flash authoring tool and I am slowly
figuring out ActionScript (with a lot of trial and errors).

The way FlashDevelop (and MTASC, the compiler used to build the apps) works is that all classes are "exported".
Because of this you need to pay attention to class name clashing (I banged my head against the wall for a while
trying to figure out why one of my test applications loaded by the shell app would do only half of the things it
was suppoed to do, and then I figure out it was because they both had a Util class, but slightly different).

Basically if a movie loads another movie and the loaded movie "shares" some classes with the loader (it exports classes with the
same name as the loader), Flash will drop every class in the loaded movie that is exported and has the same name
as a class already loaded. The result is that the loaded movie will endup calling methods in its parent clasess.

So, make sure you don't create any class that may already exist (in my case, no Shell class in a loaded app and
no Util class in the loader).

For this FlashDevelop doesn't help, since templates will create classes with pre-existing names.
But assuming you are not loading a "Chumby" app from another "Chumby app" you should be ok with my naming
convention (the main class is called ChumbyApp and if you need you'll have a Menu and Util class).
I should probably "package" the classes in some fancy URL (org.aromatic.chumby.ChumbyApp) but I am lazy.

Enjoy and let me know what you think! (also, somebody please test the apps on a real chumby)

Re: ChumbyDevelop

Good job!!! Hopefully this will help release date development.

Re: ChumbyDevelop

thanks for the template!  The sample does work on the chumby.

Re: ChumbyDevelop

Sweet, thanks.

~Ryan~