New Toronto Group
 - New Toronto Group

Using Sprites in Flex 4 Applications

| Posted on July 22th, 2011 by Derek Santos




By Derek Santos - Consultant

With Flex, we sometimes develop components that are graphically intensive, and we want those components to be as light as possible.  We could just use an actionscript only project for these scenarios, but that means we'll lose out on all the features Flex gives us.  To solve this problem, you can use a component called SpriteVisualElement.  It's a Flex component that extends FlexSprite, which means it doesn't come with all the weight of a regular UIComponent, and allows us to use the graphics layer of that sprite.

It's simple to use, just declare like you normally would like shown below.



It's also great for adding non-flex components (like other sprites) to the display list as an alternative to adding them to a UIComponent. This could be useful if your creating a game in flex, or doing any serious drawing in your application.

Enjoy!

Posted in Derek Santos, Flex, Flex Components, Sprite  | Comments (0)

Comments (0)


Add a Comment





To use reCAPTCHA you must get an API key from http://recaptcha.net/api/getkey

Allowed tags: <b><i><br>Add a new comment: