Friday, May 14, 2010

Video: Flex 4 Path to Enlightenment

The Path Object in Flex 4, the next episode in the gripping and suspenseful series CodeDependent, is now available from Adobe TV.

This episode shows how to create a simple drawing application using the new Path object in Flex 4.

This show is based on one of the 65+ demo applications that I wrote for Flex 4 Fun, a book about the graphics and animation side of Flex 4. If you want to see more about the book, check out the book site, the page where you can purchase the PrePrint version, or the apps site where all of the demos are hosted.

Here's the video:

Here is the demo application:

And here is the source code.

Here's where you can find CodeDependent on iTunes.

And here's where you can find CodeDependent on YouTube.

Enjoy.

Friday, May 7, 2010

Video: Upon Further Reflection

Creating a Reflection Container in Flex 4, Part II, the next episode in the gripping and suspenseful series CodeDependent, is now available from Adobe TV.

This show is the sequel to the previous one, in which I showed how to create a simple container for an image and it's reflection ... that didn't look that great. The sequel shows how to get a better, more realistic reflection effect by using blur, masking, and alpha gradients. My favorite part of the technique is something that I completely forgot to mention in the show: the code is soooo much simpler than code I used to write to get this effect prior to Flex 4. Check out this earlier show on a reflection effect using ActionScript and Flex 3 components. Now look at the few lines of code in the Reflexion container to get the same result. Nice, eh?

This show is based on one of the 65+ demo applications that I wrote for Flex 4 Fun, a book about the graphics and animation side of Flex 4. If you want to see more about the book, check out the book site, the page where you can purchase the PrePrint version, or the apps site where all of the demos are hosted.

Here's the video:

Here is the demo application:

And here is the source code.

Here's where you can find CodeDependent on iTunes.

And here's where you can find CodeDependent on YouTube.

Enjoy.

Thursday, April 29, 2010

Video: Reflection Container in Flex 4, Part 1

Creating a Reflection Container in Flex 4, Part 1, the next episode in the gripping and suspenseful series CodeDependent, is now available from Adobe TV.

This show is based on one of the 65+ demo applications that I wrote for Flex 4 Fun, a book about the graphics and animation side of Flex 4. You can see a book sitting next to me on the table at the start of the video. I had planned to show it in the video, but that segment got cut. I suppose the producer figured that since all I was showing was a copy of When I am King... with a printout of the Flex 4 Fun cover taped around it (since Flex 4 Fun isn't actually available in hardcover until this Summer), it really wasn't a crucial part of the show. Anyway, if you want to see more about the book, check out the book site, the page where you can purchase the PrePrint version, or the apps site where all of the demos are hosted.

This episode shows how to create a simple container in Flex 4 that holds both a BitmapImage and that image's reflection. The actual reflection we end up with, which is just a translucent/mirrored version of the original, could be improved upon... which is the point of the next show. (Oooh, I just love a good cliffhanger!)

Here's the video:

Here is the demo application:

And here is the source code.

Here's where you can find CodeDependent on iTunes.

And here's where you can find CodeDependent on YouTube.

Enjoy.

Monday, April 26, 2010

States and Components in Flex 4

Artima.com has posted another article/demo from my book Flex 4 Fun. Check out States and Components in Flex 4 to see an example of the simple new state syntax in Flex 4 for including and excluding objects in different states of an application.

Tuesday, April 13, 2010

Bending Pixels with Flex 4

Artima.com has posted one of the demos from my book Flex 4 Fun in an article on their site. Check out Bend your Pixels with Flex 4 to see a simple example of using a Pixel Bender shader to get a grayscaling effect on an image.

Wednesday, April 7, 2010

Video: Event Performance in Flex

Event Performance in Flex, the next episode in the gripping and suspenseful series CodeDependent, is now available from Adobe TV.

This episode covers the use of the updateAfterEvent() function to get better rendering performance for time-sensitve operations like mouse-interaction visuals and animations.

By default, changes to the graphics that the Flash player displays happen at the frame rate of the player (by default, 24 frames per second). This frame rate, which updates the screen every ~42 milliseconds, is fine for most visual changes on the screen. But when you need motion to be smoother, like in some animations, or need the visuals to respond quickly to user interactions, like changes in component state based on mouse movement or presses, then 24 fps may not cut it. In this case, you need to know about the updateAfterEvent() function found on some event objects.

Here's the video:

Here is the demo application:

And here is the source code.

Here's where you can find CodeDependent on iTunes.

And here's where you can find CodeDependent on YouTube.

Enjoy.

Monday, April 5, 2010

Flex 4 Fun: Available in PrePrint

Chet's handy AcrtionScript algorithm for writing a programming book:

public function writeBook():FinishedManuscript
{
 var manuscript = new FinishedManuscript();
 writeDemos(manuscript);
 writeText(manuscript);
 while (true)
 {
    edit(manuscript);
    revise(manuscript);
 }
 // TODO: Next line never executes
 return manuscript;
}

Finally, after months of writing, editing, revising, coding, explaining, revising, deliberating, cogitating, revising, formatting, reformatting, revising, snapshotting, describing, captioning, revising, and dying a little inside, my book Flex 4 Fun is finished. Almost. It just needs a little more editing and revising.

The book is content complete: all of the chapters are done, all of the demo applications compile and run, all of the text is correct as far as I know, and there are no known typos.The book could still benefit from one more review cycle, but rather than wait for that plus the printing delay until it would actually be available on bookshelves (usually 2-3 months after a book is completely complete), I wanted to push out this early version close to last month's Flex 4 release.

Flex 4 Fun is different than other Flex, or Flex 4, books I've seen; it focuses on the graphics and animation side of the SDK. I figured that's what I like to play with on Flex, it's what I know best about the platform, and it deserved a book that went deeper into these topics than the other Flex books. Sure, an overview book is good to have. Yes, you should understand how to connect Flex to a back end. Alright, you probably want to understand how to architect large Flex applications. But when you get around to creating better user experiences for that Flex client, you'll want to know more about graphics, states, skinning, and animation. And hopefully this book and its 65+ examples can help teach you how that stuff works.

Here's the books Contents page:

1. Introduction 13 2. Graphics 18 3. Filters: Easy Image Processing 60 4. States 96 5. Transitions 105 6. Skinning Components 119 7. Animation 138 8. The Animation Class 152 9. Flex Effects: The Basics 184 10. Effect Choreography 209 11. Advanced Flex Effects 230 12. Go Have Fun 258

The book is available in PrePrint form on artima.com. Go check it out and have some fun!