Tuesday, June 10, 2008

Video: Pulse

Adobe TV surprised me today by posting my Pulse demo much sooner than I thought they would. Four videos posted in just over a week. I feel like Ben Affleck, where everyone will probably get sick of me when I'm just getting started. Except that Ben has a way bigger jaw and whiter teeth. And I bet he can't program graphics applications. This demo is the first in a series of "Filthy Rich Client" applications, where I look at what it would take to enable specific graphical or animated effects on the Flex platform. The Pulse demo in particular is a Flex take on an application originally written in Java by Romain Guy. The only problem is that I wasn't quite ready to post the source (just have to go through it and make sure it's ready for leaving the nest: nicely commented, teeth brushed, lunch packed...). So watch the video for now and check back here soon if you're interested in seeing the source code and application. By the way, this kind of content is also being posted on the Flex Developer Center, so you might also put that site on your list of Flex learning bookmarks.

3 comments:

holla2040 said...

Chet,
Where in the component's instantiation lifecycle does the color setter method get called when specified as an mxml attribute? I haven't been able to figure that out from, http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000492.html
or http://www.onflex.org/ted/2007/02/flex-instantiation-life-cycle-and-event.php

Could you forward a URL that explains the order of events when objects are specified in mxml? I haven't quite figured this part of flex out yet.

Thanks and keep up the great work.
Craig

Rob McKeown said...

Rather than resetting the filters array in each setting, wouldn't it have been better to invalidateProperties() and then reset the filters in commitProperties()?

Chet Haase said...

Rob,

invalidating and handling revalidation in commitProperties() is a better approach in general, and is the route that most real apps should use. In this case, I chose to use this more direct approach because I wanted to focus on the point of the demo (animating effects) and not more general Flex programming concepts. Also, as long as your Timer rate (the internal Timer used by the effects) is not appreciably faster than your frame rate, you will not waste effort setting the filter directly. The thing you want to avoid in general is setting properties several times per frame, which is a waste of effort. So if your effect is causing you to reset your filters at roughly the frame rate of Flash, then you will not be wasting time setting it invisbly several times per frame.