Friday, October 30, 2009

Video: Resizing AIR Windows with Flex 4 Effects

Resize Adobe AIR Windows through Custom Flex 4 Effects Interpolation, the next and verbosely entitled episode in the gripping and suspenseful series CodeDependent, is now available from Adobe TV.

In this show, we see how to apply what we learned about arbitrary type interpolation in a previous episode to the specific use case of resizing an AIR window. The ability to animate properties of arbitrary type is one of the key new features in the Flex 4 effects system, and it comes in handy for this use case where animating the x, y, width, and height properties of the native window aren't good enough. Instead, we need to interpolation a Rectangle object so that we can atomically set the bounds of the native window with each animation update.

Here's the video:

Instead of embedding the application like I normally do, I'm just going to provide this link to it. It's a link to an AIR application which you would need to install and run locally, because that's the way that AIR works. You may not care enough to do this, since it's just a live demonstration of what you see in the video. But it's here for completeness.

And here is the source code.

Finally, here's where you can find the CodeDependent videos on iTunes.

Enjoy.

6 comments:

Unknown said...

Chet, how to add effect when adding a child in vbox or hbox? I have not move to Flex 4 yet so I will need flex 3 solution :-)

Chet Haase said...

@Viv: You mean I finally post the answer to the question you asked me a couple of months ago, and you follow up with another question? Are we infinitely recursing?
Actually, I like the questions - they give me ideas for more videos/examples; I'm shooting some more shows this week and I'll put this on the list of things to try.

Unknown said...

By the way now I am a famous guy - I was mentioned in Chet Haase live !!!! I am the new "Joe the plumber" :-)))

Chet Haase said...

I guess that makes me famous, too, by the transitive property of fame, since you're now famous and you mentioned me in your comment.

Fame is finally here. Fortune will surely follow.

Jonathan Dumaine said...

Hey Chet, thanks for the great walkthrough. This has been a pain in the posterior in Flex 4/AIR. Any chance you could whip up an example of this with a custom chrome?

There's a good Flex 3 example of this here (http://www.wabysabi.com/blog/2008/01/29/example-air-app-dynamically-resizing-windows-based-on-content-area/): but when porting that example to spark components... it's just not working!

Thanks Chet, you rock!

Jonathan

Jonathan Dumaine said...

Source code for my port: http://dl.getdropbox.com/u/672147/Flex4ChromelessTest.fxp.zip