Posts Tagged ‘Flash’

Creating a Chumby Configuration Widget

Friday, February 26th, 2010

In my last post, we quickly went over Writing your first Chumby widget. This time, we’ll expand on that by adding a configuration widget.

A configuration widget is another Flash file that sets up parameters for your Chumby widget, so those settings are available when the widget loads into your Chumby. For example, perhapse you have an analog clock widget. You could create a configuration widget that allows someone to choose a color for the face of the clock, or whether or not to display the second hand. The user could choose a color and save their preferences in the Chumby database. Then, when their Chumby loads your clock widget, it would look for and download any settings for that widget.

Here’s what we’ll need:

(more…)

Zoom Creates a Self Promo—For Reel

Thursday, February 11th, 2010

Yesterday our amazingly talented, patient, smart, nerdy, impatient, committed, ingenious, thoughtful, creative, resourceful and brilliant development team put the finishing touches on the Zoom Creates self-promo reel. These guys are absolutely unbelievable. We described our vision for the reel and they told us: “That’s impossible. You can’t do that. The technology doesn’t exist. You cannot change the laws of physics. We will need super-computers, expensive software, years to write code, more chips, salsa and milkshakes than you can afford.” Then, five minutes later (slight exaggeration) came back to us with a solution–an ingenious solution: open-source software. The only hitch was they had to teach themselves how to use it. And that they did. They figured out how to use Blender for the 3d animation and Kdenlive for the video post processing. Sprinkle in some Flash and great ideas of their own (watch the mouse pointer jump from one panel to the next and the animated atom) and there is no stopping these guys.

They even used math! Lots of math. That was the most mind-boggling thing I witnessed. I like math and all but if it were me putting this thing together, I think I would have approached it more organically, finding the music then individually timing and positioning the pieces. Not these guys. After the look and feel/animation comps were completed, they looked at the music, the number of pieces and the frame rate etc. and gave each piece a number and had it all laid out on a table with little pieces of paper. Independently, Kurtis worked on the music while Kris positioned all the pieces and when they put them both together, it was like magic. The animation synced up with the music almost perfectly. It was unbelievable. These guys know what they talking about. Well done, lads.

This entire project has been such a great team effort. Everyone here at Zoom Creates contributed. The countless hours of concepting, discussing, designing, scheduling, production, learning, listening, laughing and collaborating have truly produced a project to be proud of. Not only does it show off some of Zoom’s best work, it is a portfolio piece in itself.

Writing your first Chumby widget

Monday, February 1st, 2010

tic-toc-goes-the-clockSo, you got your first Chumby and have browsed through the 1500 open source widgets, and now you’re ready to contribute to the open source community by writing your own widget. There’s lots of resources out there, so we’ll just cover the basics here.

Here’s what you need:

  • A Chumby
  • Adobe Flash or other developing environment for creating SWF files
  • An account at Chumby.com

Open up Flash. Set your size to 320 x 240 and frame rate to 12 frames per second. In Publish Settings, set the Player to Flash Player 8 and the Script to ActionScript 2.0. Chumby allows widget up to 100kb in size, which is plenty of room for code, but can get tight when working with audio and video.

For this tutorial, we’ll make an analog clock. But there are hundreds of clocks already! Yes there are, but I like to have every other widget be a clock, and I’ve only found about a dozen clocks that I really like. That is one of its primary functions, after all.

First of all, set up your assets. You’ll need three clock hands, positioned in the center of the stage, with the registration point properly set. Name them hourHand_mc, minuteHand_mc, and secondhand_mc.

OK, now the code:

onEnterFrame = function() {
	dt = new Date();
	//set hour hand
	hrs = dt.getHours()+dt.getMinutes()/60+dt.getSeconds()/3600;
	angle = hrs*30;
	if (angle!=hourHand_mc._rotation) {
		hourHand _mc._rotation = angle;
	}
	//set minute hand
	mns = dt.getMinutes()+dt.getSeconds()/60;
	angle = mns*6;
	if (angle!=minuteHand_mc._rotation) {
		minuteHand _mc._rotation = angle;
	}
	//set second hand
	scs = dt.getSeconds();
	angle = scs*6;
	if (angle!=secondHand_mc._rotation) {
		secondHand _mc._rotation = angle;
	}
}

Let’s break it down. On each frame we create a new date object. Then we get the hours of the date object. We also add in the minutes and seconds because we want the hour hand to move a tiny bit every second, not just once an hour. Next we convert the hours into degrees by multiplying by 30. (360 degrees per 12 hours makes 30 degrees per hour). Next we check if the hour hand needs to be changed. It should only be changed once every 12 frames, not every frame. Using this if statement prevents unnecessary redrawing of the screen, which can save processing time and make a widget run more smoothly. Though, you’ll probably not notice any difference in this simple example.

The minute hand and second hand go through the same process.

OK, save it, publish it, and upload it to Chumby.com, but don’t make it public yet. Add it to a channel on your chumby and try it out. You’ll undoubtedly find lots of things to tweak with your clock. Did you even give your clock a face? Maybe it needs a tick sound, or a gong on every hour. Maybe you don’t want a typical analog clock. Changing the code for a digital clock should be pretty easy.

This is a simple example, but it should get you on your way. In my next post, I’ll write about creating a configuration file, and playing with the accelerometer. (unless I forget or change my mind). Until then, make a cool clock.

The Problem with Probability

Friday, January 22nd, 2010

If you were to flip a coin 10 times, and it comes up heads each time, you might think, “On the next flip, it’s SURE to come up tails – it’s due.” If you flip the coin 10 more times and again it comes up heads each time, you might think, “The next flip will surely be HEADS. Just look at the statistics.” Of course, we know that any flip has just as much chance as being heads as it does tails (assuming the coin is evenly weighted and symmetrical). So how many flips does it take to change our feeling about the next flip? Somewhere between 10 and 20 flips? (more…)

I got a Chumby

Friday, January 8th, 2010

Chumby One running Pandora internet radio

Chumby One running Pandora internet radio

I knew my wife loved me when she got me a Chumby for Christmas, without really knowing what it was.  What is a Chumby you ask?  It’s hard to define, but you might call it a wifi-internet-clock-radio, with a touch screen, accelerometer, and other inputs for running and interacting with Flash-based widgets.  But in the right hands, it’s so much more.  It’s an open source linux-based playground.  Even the hardware can be tinkered with (although I’m not about to crack open the case on my new $120 toy). (more…)

Get Jollified!

Wednesday, December 16th, 2009

‘Twas the weeks before Christmas and all through The Zoom,
Zoomers were fighting off holiday gloom.
The projects were done, to the clients with care,
In hopes that AR would soon be there.

When out on the Internet arose such a clatter,
When asked, Zoomers said, “Why nothing’s the matter!”
Away to the laptops they flew in a flash,
Started the webcam and cleared all the cache.

Zoomers engaged in the holiday fun,
Added hats, beards and noses, each and everyone.
Twas a Jollified Christmas, brought straight from Zoom,
From there on out, no more holiday gloom.

From our stockings to yours, we are pleased to bring you Jollified, a festive holiday Augmented Reality flash application. Not unlike elves, we have been tinkering and fussing over Jollified for weeks, in the hopes of bringing you tidings of cheer and well wishes.

To get Jollified, please watch the video below and then visit the official Jollified website. Play around, snap a photo of your Jollified creations and share the merry with family and friends.

‘Tis the season to get Jollified!

Flash Camera

Monday, December 14th, 2009

The Flash plugin is required to view this object.

On a recent project (which will be revealed later this week) we needed to save an image created in a Flash application, using AS3 and PHP. It turned out to be really easy. Here’s how we did it…

(more…)

Stopwatch for Cubers ver 2.0

Thursday, December 3rd, 2009

What do you know? I did get around to updating my timer. Introducing Cube Clock 2.0 for Rubik’s Cubers (and other cubes) with fancy new graphics, sounds, and a settings screen. See Stopwatch for Cubers for the original version.

The Flash plugin is required to view this object.

If you want to study your cube before the time starts, click the SETUP button to specify how many seconds you would like to study. The default is 0 which means the time starts as soon as you release the space bar (or click the START button). You can also toggle sounds on or off.

Let me know if you would like to see any features in the next version. And, of course, post your times in the comments.

Cube Timer v2.0 Source (FLA)

What a tasty flash game…

Thursday, November 26th, 2009

Here’s a game for all ya’ll just in time for the big turkey day. Feel free to download the .fla file and see how this game is built. Don’t forget to post your scores in the comments!

The Flash plugin is required to view this object.

Here is the FLA file.

Stopwatch for Cubers

Thursday, November 12th, 2009

A while ago I built a simple Flash app for people who can solve a Rubik’s Cube (or other cube brand).  Other apps that I’ve seen require that you use the mouse to click the start and stop buttons.  That can add a few extra seconds to your time.  On my solution, the Cube Clock, the time starts when you pick up the cube from the keyboard, releasing the space bar.  Then when you’re finished solving the cube, just tap the space bar again and the timer will stop.

Some timers have a feature that allow you to examine the cube for 15 seconds before the time starts.  I might add that feature into the next version (if there is a next version).  So, get your cube out and try out this timer.  And be sure to post your time in the comments area.