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.

6 comments:

Anonymous said...

Hi Chet Haase,

great video! I was trying to download the source code to play around with it but the link ( http://haasehouse.com/Chet/Flex/CodeDependent/files/Scribbler.zip ) appears broken?

Kind regards,
Theo Lagendijk

Francisc said...

Hey, Chet!
Congratulations on the very nice work you are doing.

Just wanted to point out that the link to your Codedepended show on Adobe TV has an extra "s".

That is: http://tv.adobe.com/show/codedependent

Chet Haase said...

Thanks for the error reports - I've fixed the link to the source code (should have been .mxml, not .zip) and to the Adobe TV show (I bet I have that same link error on every blog post - argh!).

Guillaume said...

Hi Chet,

Just a quick question regarding the Path Object since it seems there is no event dispatched this object.

Let say in a app we dynamically create custom shape from a path (for instance a square).
My question is, Is there a way to handle a mouse_over or mouse_out events on our 'shape' ?

I tried using a Graphic object that house my shape, so I can listen mouse events, but it doesn't work since the Graphic is actually a big rectangle that cover my shape.

regards,
Guillaume

Chet Haase said...

@Gillaume: Path, and the other graphic primitives, were intended to be very lightweight objects so that there would not be penalties from using lots of them in a scene (which is easy to do with components that are composed of many of these things). So you can't listen in directly on the object.
The general approach I've used for listening to events on objects is to put them inside a Group and listen to events on the Group instead. I don't know off-hand whether this would limit the events to only those pixels of the Path object, but I'm thinking this would work because the transparent pixels of the group would probably just let the event fall through to the object behind it.

Tina in Boston said...

@Guillaume, maybe you've worked this out, but I was able to detect MouseEvent for a FilledElement object here:

http://flexair.blogspot.com/2010/07/detect-mouseevent-in-filledelement.html