« June 2008 | Main | August 2008 »

July 30, 2008

Advanced CSS Techniques and Programmatic Skinning

At the start of this month I attended the Boston Flex User Group Meeting where TR Coffey, Design Lead at Allurent (where I also work) gave a talk about Advanced CSS Techniques and Programmatic Skinning. Below are some rough notes I took during his talk.


TR comes to Flex from a visual design background, not coding. Has approached design as a picture to code process. Not only has he created the visual design but has also been involved in coding the styling to make it work.

Flex provides a great framework to start off from using Halo and CSS. Try to use it before going into any of the more labor intense methods. If CSS doesn't work the other options are: graphic skins, states, and programmatic skins.

Using graphic skins in a program like Flash (also available in Photoshop and Illistrator) lets you use scale 9, nested movie clips to provide global control, and work with percentage sized components.

State based skinning can be done with MXML components or on the Flash timeline. State skinning allows transitions between states (color fading, resizing, animations, etc.). For Flash the timeline has labels for each state. Component utility plug-in for Flash exists to help with the creation and exporting for use in Flex. Work to maintain timelines skins is very high.

When creating custom programmatic skins look at Halo border. It does a lot of heavy lifting.Are required to do things like set the border style to solid to get it to show up. Makes heavy use of theme color but doesn't provide that much subtle control over how colors get used.

If creating a custom border skin extend RectangularBorder, Border, or as a last resort ProgrammaticSkin. RectangularBorder gives edge metrics and other utility functions that shorten the development time. All of the border skin drawing will take place in updateDisplayList(). If style properties change call invalidateDisplayList() to trigger a redraw.

He demonstrated an issue with the default Halo border with thick borders and rounded corners. Should be logging a bug about that.

Have your skin pickup custom CSS properties from the style manager to offer control not found in the standard Halo skins. Always use hyphens in the CSS file for property names and camel case in code. The utility function drawRoundRect() gives you control to make almost any kind of border you want.

When creating a CSS file, define type selectors for defaults then cascade down to class selectors for overrides. Handy to make a CSS skin reference ClassReference(null) to turn it off for something like an up-down button. Components should have default values baked in that can then be overridden by CSS.

When to use inline MXML vs. style sheets: Designers don't really want to muck with MXML to style the application so providing style sheet properties that the skin picks up makes life easier.

Trade off between making a single mega-skin like Halo border, versus multiple smaller skins each with a single purpose. Mega skins allow more layers of effects but are harder to maintain.

Allurent tends to push more skin configuration to the style sheet since we are making products and having a single configuration point makes it easier. Having it in a style sheet instead of inline MXML also allows for external style sheet loading, compiled independent of the rest of the application. Since styling is cross component having everything in one place is best.

Tags: css flex styling

July 29, 2008

For Loop Foolishness

I spent way too long yesterday debugging a stupid typo all the while thinking maybe I'd stumbled across a compiler bug. The code in question:

for (var name:String in _data);
{
    trace(name, _data[name]);
}

In the debugger I could clearly see that my _data object had multiple dynamic properties but I only ever saw one value printed out. In retrospect it was code blindness that comes from working with too many languages that use semicolons at the end of lines. While semicolons are optional in ActionScript, I always put them on, so my eyes just kept skimming over the fact that at the end of the for loop I had a stray one kicking around. Removing it magically made everything work again.

Tags: bug code flex

July 28, 2008

Busy Weekend

Its been a busy weekend.

The Tour de France wrapped up this weekend with an everything on the line time trial on Saturday and another fabulous sprint finish on the Champs Elysee on Sunday. Congratulations to Carlos Sastre, this year's winner. My DVR can rest for awhile now that I don't have 4-5 hours of live coverage to zoom through each night. Versus' prime time coverage just can't compare to Phil Liggett and Paul Sherwen.

Saturday also included an outing to Midwest Grill followed by games in celebration of Craig's birthday. Way too much yummy food and gaming but a great way to spend the rest of the day.

Sunday consisted of helping Erin and Pete move into an apartment down the street, but was mostly taken up by painting my entryway. Stephanie has been helping me pick out colors and look for deals on paint. A couple of months ago she came across this great peach color which fit with the overall scheme. Problem is, now that I've got one room done, I'm itching to do the rest.

Tags: gilmanmanor life photos

July 25, 2008

Antennae 1.2.1 Released

Antennae version 1.2.1 has been released. Grab it from http://code.google.com/p/antennae/. Highlights of this release include:

  • Support for AIR based FlexUnit testing, including a project template
  • Other minor bug fixes

For anyone not familiar with Antennae here is a brief description:

Antennae is an open-source project designed to automate the building and testing of Flex applications. It uses Ant and Java to provide cross platform utilities to compile Flex libraries, Flex applications, generate FlexUnit TestSuites, and run FlexUnit tests in an automated manner. Antennae also defines a framework for building complex projects with multiple dependencies and intelligently handling recompilation.

Tags: ant antennae flex

July 21, 2008

Fireworks

While still in the stupor of jet leg I decided it would be a good idea to try my hand at free handing with my camera some shots of Boston's 4th of July Fireworks. My camera has a fireworks mode on it that worked surprisingly well. I can only image they would get better if I used a tripod.

Tags: boston fireworks photos

July 20, 2008

Nepal Photos

I've finally finished going through all of my Nepal photos and have put them online. My next effort will be to go through and comment them, but don't hold your breathe on that. All told I took almost 1000 pictures and culled that down to about 650 by weeding out the blurry and bad. Nepal made for some challenging shooting with the frequently overcast and changing weather conditions. I'm sure some of the photos could use a little touch-up magic with Photoshop but that's stepping a little outside my standard photo expertise.

Tags: links nepal photos

July 8, 2008

Mt. Flume and Mt. Liberty

As my last hike before heading to Nepal I took a trip up to the White Mountains in NH to hike Mt. Flume and Mt. Liberty. These are some of the photos I took along the hike to make sure my new camera worked well.

Tags: flume hike liberty photos

July 4, 2008

Shantaram

Gregory David Robert's epic tale "Shantaram" is a sweeping story set in Bombay. While parts of the tale are based on the author's life this work of fiction feels more like an action packed autobiography given the rich details lavished upon on the city and all of the primary characters within. After an audacious prison escape the main character flees to Bombay in hopes of avoiding escape. Through a fortunate series of events the main character soon finds himself in the employ of the mafia and associating with an eclectic group of friends. Along the way he experiences all aspects of Indian culture from rural, slum, and well-to-do city life. A nagging conscious contributes to him running a health clinic in the slum, while also learning new languages, and struggling with love.

At over 925 pages the scope and expanse of the story is hard to summarize. The writing is clean and approachable. Throughout the book the author has many discussions about philosophy and science as it relates to the meaning and purpose of life. The author calls this type of discussion cosmosophy, although I don't recall that term being used in the book itself. Ignoring that tangent the story itself is a joy a read and while at times it felt like the events could have really happened to the author, the improbable number of fortunate coincidences found in the book give away any credibility that thought may have had.

Tags: bombay books

The Road

Cormac McCarthy's "The Road" is a post apocalyptic tour de force. The writing is curt, brutal, and extremely engaging. It took me some time to adjust to the author's writing style but once I did I found it hard to put the book down. The book's dark theme relentlessly continues and little solace is found even in the closing pages which only adds to the gravity of the world presented within it. The nearly punctuation less dialog matches the barren landscape the characters inhabit and after awhile I found it softer on the eyes than a typical quote filled page. The struggle to survive portrayed in the book is inspirational despite the lack of a happy ending. Overall a fantastic read.

Tags: books

Into Thin Air

While in Nepal trekking up to Everest Base Camp it felt appropriate to read Jon Krakauer's "Into Thin Air". I was not attempting the same physical feat of the author, but I did traverse the same paths up to the base camp, which gave me familiarity with the first few parts of the book. The version of the book that I read included an additional section at the end which offered the author's rebuttal of another book covering the same events. The inconsistencies seemed to focus mostly on the portrayal of people in the book versus the over arching series of events that happened. With that in mind the experience and horror captured in the book was mesmerizing.

The book mentions many times that getting up is easy, the hard part is getting down. The fatigue and oxygen deprivation experienced by climbers reaching the top leaves them ill equipped to make the equally challenging descent back down to camp 4. Amateur climbers combined with what to me felt like hubris on the part of various people in the face of a severe storm resulted in one of Everest's most deadly events. Jon's prose quickly engaged me in the action and his easy storytelling at times almost made me think the book was a work of fiction. Alas the events are true and many exceptional people lost their lives on Everest that May of 1996.

If I ever had any vague thoughts of summiting such a peak this book cured me of any such notion. I don't pose the spirit or mentality he alludes to in the book that has driven so many others to attempt and succeed at climbing Everest. While my drive and curiosity carried me to Nepal and higher than I've ever been, I was happy enough to gaze upon Everest without feeling the need to summit it.

Tags: books everest nepal

Psychology and Consumer Culture

"Psychology and Consumer Culture" is a collection of essays edited by Tim Kasser and Allen D. Kanner. Kasser is the author of "The High Price of Materialism", a book I highly recommend reading. The essays in this book cover four main areas: i) Problems of Materialism, Capitalism, and Consumption ii) Theoretical Perspectives iii) Clinical Issues and iv) The Influence of Commercialism on Child Development. Unlike most readings of non-fiction books like this one, I didn't take many notes. Part of the reason was I read this during my trip to Nepal and it wasn't always handy to have a notebook around to capture my thoughts. The primary reason though was that most of the essays in the book are dense and to really appreciate all of the material presented in the book, I want to give them all a second reading.

The editors purposely didn't offer a summarized conclusion about the various essays to ensure that anyone considering pursuing further research on the topic wasn't influenced by what they thought the next big thing should be. While I didn't even begin digest all of the content one of the main themes was that a lot of the research by psychologists in this field is hidden from public view. Marketing and advertising research by companies frequently involves psychologists to study the impact on specific segments of the population (such as young children). This research is done at the behest of a company and as such the results are considered trade secrets and will never see the light of day. The findings are used to create better ads but not to help those afflicted with illnesses or quality of life issues related to consumerism.

The various essay authors come from a wide range of backgrounds and areas of focus. By approaching the the topic from so many different angles a wide and disturbing picture is painted. Many of the core findings were reflected in Kasser's other book but are examined in much greater detail in this book. With another read through the essays I'll have more points to talk about but in the meantime there was one quote I found that captured some of the central themes: "The story that advertising tells is that the way to be happy, to find satisfaction, and to be free politically is through the consumption of materials objects." [252].

Tags: books consumerism

I Was Told There'd Be Cake

Sloane Crosley's "I Was Told There'd Be Cake" is a collection of essays on a wide range of topics from family matters to friendly surprises in the bathroom. What intrigued me most about the collection was that it's from a voice of my generation. Many of the comments in the book are very similar to what I grew up with, what I experienced, and most often relate to. The rift on Oregon Trail found a special place in my heart. It almost makes me want to buy Busted Tees "You Have Died of Dysentery" shirt :) The book is a quick read as the writing style is light. While funny, the humor feels forced at times and sometimes strays too much off-topic. I'll be curious to see what her next project is as I can only think her writing will be more polished in her next effort.

Tags: books life

July 3, 2008

Wow

While I'm still in a jet lagged stupor, I am back home. In summary, the trip was phenomenal. The varied Nepal landscape was a lush rich green fed by the first rains of the monsoon season. It made for hiking in cloudy mornings and rainy afternoons but the weather cleared during our summit of Kala Patthar and provided mesmerizing views of Everest along with the other almost countless peaks in every direction. I've got over 700 pictures I need to wade through so it will take some time to get the photos online but I'll try to get a few up in the near future to wet your appetite :)

Tags: nepal trip

About