Friday, September 25, 2009

24-bit


I was thinking about a visual to use in a talk where I was explaining colour depth. Here is something playful that resulted from my quest for clarity. Open 24-bit Experiment

Saturday, September 12, 2009

Another drop[down] in the bucket part II















Content on this page requires a newer version of Adobe Flash Player.


Get Adobe Flash player







This is a Flash-based AS3 drop down menu. It has two parts:


  1. DropDown.as (download .zip here)
  2. Frame script and appropriate Library items. Menus could easily be scripted but why not use the visual power of the Flash authoring tool. A script sample is found below.

What follows is sample runtime code. This would be found as a frame script in a Flash authoring tooled constructed file.


Import the DropDown class (DropDown.as).

import DropDown;


XML that provides info about the content and structure of the menu.

var myXML:XML = <menu><item>People<item>Michael<item>Teaching</item><item>Design</item></item><item>Jes</item></item><item>Cities<item>Winnipeg</item><item>Toronto Canada World Universe<item>Annex</item><item>Cabbagetown</item></item></item><item>Bicycles<item>Trek<item>Mountain</item><item>Road</item></item><item>Giant<item>Mountain</item><item>Road</item></item></item><item>Airplanes<item>Boeing<item>737</item><item>727</item></item><item>Airbus<item>A320</item><item>A319</item></item></item></menu;


Create a new DropDown instance.

var menu:DropDown = new DropDown(myXML);


Add the menu graphics.

//The arguments for this method are:
//@ level = submenu level to add graphic to
//@ libRef = A string. Refers to the class names
// of the library items used as graphic assets.
// You will require movie clips in your Library that
// are set to "export for actionscript".
// Each clip should have two frames and
// a stop() on the first frame.
// Frame 1 = up state, Frame 2 = over state.
//
// *** Note: Level 0 is unseen but currently
// *** you must add a graphic asset.
//
menu.addMenuGraphic(0, "MC_menuItem");
menu.addMenuGraphic(1, "MC_menuItem");
menu.addMenuGraphic(2, "MC_menuItemSub");
menu.addMenuGraphic(3, "MC_menuItemSub2");



Initialize the menu. XML is read and parsed and the menu is drawn.

menu.initialize();



Position the menu.

menu.x = 10; menu.y = 10;



Close all the menu items that should be closed to begin.

menu.closeMenusByLabel(["Cities", "Bicycles", "Airplanes"]);



Add the menu to the stage.

addChild(menu);



Add listener for user clicks of the menu.

menu.addEventListener("MENU_CLICKED", onMenuClicked);



Add handler for menu click event.

function onMenuClicked($e) {
trace ("Menu clicked: " + menu.menu_selected.label + " " + menu.menu_selected.name + " " + menu.menu_selected.index);
}


I would love suggestions to make this better.

Sunday, July 26, 2009

Another drop[down] in the bucket.


Flash beginners often struggle with big goals coupled with a deficit in applied knowledge. Excited about what they know is possible, they make admirable attempts to employ tools in their applications that require more than a freshman's knowhow. One example, is the drop down menu.

Generally, the first attempts involve some of the most convoluted timeline-based design that you can possibly imagine. Infinite movie clip symbols designed to cover every sliding menu possibility. I too once made attempts using this approach. I know how hard and time consuming a process it is to use such a cumbersome tool, so unsuited to the task and end up with an unsatisfactory and inflexible result.

I have created a little drop down menu component that I am going to share. It is written in AS3 and is meant for Flash authoring tool users. Here is a glitchy preview. Code and more examples will follow soon.

Thursday, July 2, 2009

Canada Day Nodes

Canada Day passes uneventfully as I lay sick in bed. I play with a little Flash experiment that I had been toying with days before.

It is sort of old school as Flash experiments go. Some nodes, represented as circles, jiggling around the screen. Some lines connecting the nodes. The brighter the connecting line, the closer the nodes.


One thing I discover is that I still don't have a simple way of converting a number to a hex value. I still convert my RGB values to hex Strings and then use parseInt to bring them back to the world of numbers. More will follow...


Monday, May 18, 2009

Magnolia

Yesterday, I had a wonderful opportunity to enjoy a magnificent little being up close. Unfortunately, the circumstances surrounding our visit were quite unfortunate. My guest was a beautiful little bird known as Dendroica magnolia or the Magnolia Warbler.

He was an adult male who had taken a wrong turn and found himself face to face with a pane of glass. I found him laying semi-conscious next to the spot where I park my bike at home. My partner and I immediately hit the ground beside him and checked his vitals.

The evidence was good that he took the brunt of the collision on his left hand side. He was lilting to the left. His feathers were badly matted on the same side. Most alarmingly, his left eye was swollen shut.

We sat and watched him for many minutes, eventually deciding that we needed to head up to our apartment but not without him. We have many cats in the neighborhood. My partner gently tried to pick him up a
nd he gingerly moved onto her fingers. We brought him upstairs and made a little spot for him to sit with us on our deck.

On further inspection it was difficult to tell how badly damaged his left eye was. It slowly pooled with blood. The drop would reach a critical mass and be sucked up by the plumage surrounding his eye. I felt very sad knowing that if he regained his wits, he would have to suffer a difficult period of pain and adjustment. These birds hunt insects. I am sure that vision is essential to the successful hunt.

After two hours of gentle tending and observation, my partner decided that we should bring him inside to provide him with a warm and
quiet space to recover. She prepared a large box for him and moved outside. As she approached, he suddenly took a lateral step on the lip of the planter where he was perched. Then another. He spread his wings and looking very sure of himself launched upwards, dipped for a moment and then shot off over the balcony railing. Into a stiff wind he launched himself briefly upwards and then plummeted down towards the two-story maple behind our apartment. He was gone. We were very happy but both felt worried about the evening ahead.



Friday, May 8, 2009

Every man, woman and child needs a blog don't they? I will be a proud late bloomer in the blogosphere ecosystem. Let the neurons fire and the drivel flow.