Subscribe to RSS
get email updates
home | about | pixDif AIR app | video tutorials
polyGeek.com

place your ad here

Web Premium



Get Qwest High Speed Internet



Explorer : Animate a SimpleMotionPath with Flex 4

January 13th, 2010 . by polygeek

If you haven’t played with the Animate class in Flex 4 yet then be prepared. It’s fantastic. It’s just like the Flex 3 Animation would have been if it had been done right. Yeah, Flex 3 was sort of tossed together and that states crap they fed us was, well, inedible. But not any more. The difference is like the Original star ship Enterprise compared to the Rebooted Enterprise. Remember how the original Enterprise never looked right for any angle and didn’t move at all? But the Rebooted Enterprise can come out of warp in the atmosphere of Titan and majestically lift out of the cloud cover like it ain’t no thing at all. That’s the difference between Flex 3 to Flex 4 animations. Except we didn’t have to wait 40 damn years for them to get it right.

I present to you here a simple little explorer to play around with animating some text. The GRAY text is where the animation will start from and the BLACK text is where it will come to a stop. You can use the sliders to move the two <Labels> to the spots you want them and then engage.

view source

Setting up the animations couldn’t be easier. Below is the basic form that I follow for all the properties I want to animate:

<s:Animate
    id="ani"
    target="animatedLabel"
    duration="1000">
    <s:SimpleMotionPath
       property="x"
       valueFrom="0" valueTo="250" />
</s:Animate>

Check out the source code. Couldn’t be easier . . . well I guess it could be easier if you could just tell your computer to animate a property for you just like the crew of the Enterprise can tell the ships computer to move the ship. But that’s probably a few versions away.

I’m just getting warmed up on Flex 4. Much more to come in the near future.

If something here has proved valuable to you then feel free to drop a couple of bucks in the tip-jar.

Post to Twitter Post to Delicious Post to Facebook Post to Reddit Post to StumbleUpon


similar posts

3 Responses to “Explorer : Animate a SimpleMotionPath with Flex 4”


comment number 1 by: Ely Greenfield

This is hilarious. I'm going to print that out and pin it to Chet Haase's wall.

comment number 2 by: polygeek

@Ely, I vividly remember when Kieth Peters first commented on my blog here many years back. It left me jumping up and down and saying, “OMG-OMG I can’t believe Kieth Peters read let alone posted on my blog.” Now it’s happened twice. Thanks. :)

comment number 3 by: Fre

Thanks for this, it's been a great help for me.

I do have one question. Is it possible to change the position of the Anchor Point via a Flex property? I'm trying to do a scaleX/Y animation on mouseOver/mouseOver, but it grows/shrinks from the top left point, while I want it to grow from the middle.

   Welcome back (Change)

Leave a Reply

comment feed RSS   subscribe to this comment thread

Recent Posts

   



polyGeek.com

© Copyright 2008 polyGeek.com / Dan Florio, All Rights Reserved Except Where Explicitly Stated
Web Developement Blogs - Blog Catalog Blog Directory
M2 Websites
Local Directory for Los Angeles, CA

Better Tag Cloud