Topic: Sucess with OpenLaszlo Open Source Flash Tools

Has anyone built widgets using the OpenLaszlo open source Flash tool chain? 

It was mentioned in  a couple of other posts.  I was able to get a hello world level widget with an icon and a couple of buttons built and running on my Chumby.  However, it doesn't seem to work with the virtual Chumby (I think the generated code doesn't seem to be happy to be nested in another movie)? 

Also the size of the generated swf file seems to be large from this tool chain, almost 120KB for hello world.

Anyone else out there using OpenLaszlo?

Re: Sucess with OpenLaszlo Open Source Flash Tools

Have you had any more luck, Hollings?  I'm a bit bummed to not see any responses to your post.  I think it would be great to have a documented open source alternative for chumby widget development.

Re: Sucess with OpenLaszlo Open Source Flash Tools

I've been playing with OpenLaszlo. I get large SWF files as well, 96k for the minimal Hello World. Added things adds to the size, of course, but the 96k seems to be a baseline size for the OpenLaszlo framework.

I really liked the Indian Head test pattern widget. So I wanted to do a widget that flipped through a number of common TV test patterns. Alas, that 96k baseline, plus the size of the image resources themselves balloon it to nearly 200k. Ugh! I guess I'll have to make a separate widget for each screen. But, even so, each of those will be around 100k, 5 times the size of the existing Indian Head test pattern widget.

It doesn't help that I'm old and used to straight procedural languages. Declarative ones like OpenLaszlo hurt my head. I can't even figure out how to kick off a method upon widget load, so I can't get the widget to start flipping test cards on its own.

Then I thought about making a clock. I have an old OS X dashboard widget that shows a clock using images of nixie tubes. That should be easy. But I have yet figured out how to pull the current time in OpenLaszlo. I may just be missing something easy.

Then I thought about using a C-64 font TTF to make a little C-64 fake emulator. But the C-64 font I found on the web won't work inside a Flash app. Dunno why. (Not a Chumby-specific problem at all.)

I guess the bottom line is, while most of my problems stem from my inexperience with the framework, that 96k baseline penalty will make any OpenLaszlo widget bloated.

Re: Sucess with OpenLaszlo Open Source Flash Tools

Have you tried SfwCompressor?
http://fileforum.betanews.com/detail/sw … 24845900/1

Re: Sucess with OpenLaszlo Open Source Flash Tools

I have got things working ok with OpenLaszlo (other than files being a bit big). 

The key for getting network connections to work was to use the following for a canvas definition:

<canvas proxied="false" width="320" height="240">

By adding the proxied="false"  I am able to load images and xml feeds over the network.

Also, if you want to run a method on startup of a widget here is what I used.  The
initFunc method gets called on load, and the "cycle" method is called every 5 seconds to change the content on the screen.

<view id="first" width="320" height="240" bgcolor="#cca752" oninit="first.initFunc()">

..

<method name="initFunc">
             ...
             first.cycleDelegate = new LzDelegate( this, "cycle" );
             first.cycle();
</method>

<method name="cycle">
            ...

            var slice = 5000;
            LzTimer.addTimer( first.cycleDelegate  ,  slice );
</method>

Hope this saves others some time.

P.S. Things sort of work on a virtual chumby, but not everything (like missing labels on buttons).

Re: Sucess with OpenLaszlo Open Source Flash Tools

If you want to be more "down and dirty" with a more conventional programming approach, I'd suggest using Ming in combination with your favorite programming language.

What I'd like to see is someone create an ECMAscript binding to Ming (using KJS or Spidermonkey)- I'd even be tempted to put such a thing in the firmware of the device.

Re: Sucess with OpenLaszlo Open Source Flash Tools

Oh, "oninit"! (Slaps forehead.) Thanks!

Yeah, without the proxies flag, it'll assume that there's a Laszlo server on the back-end to act as a proxy.

I've also been looking at haXe as an alternative. HelloWorld is only 4k. Haven't done anything more with it than that, yet. But it did work on the chumby.

8 (edited by phord 2007-11-20 04:51:36)

Re: Sucess with OpenLaszlo Open Source Flash Tools

I built a widget today using FlashDevelop and pure ActionScript.  I don't know if this would be useful to you guys, but the resulting SWF file was only 1.5k.

http://www.flashdevelop.org/community/