Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
AmerSoft

Use BlitMask with Flex

Recommended Posts

Hello Jack , thank you for the amazing BlitMask , it is wonderful :D

 

my question is : how can i use it with Flex 4.x ( I use Flash Builder 4.5) ?

when I try to use it within a Group component:

 

blitMask = new BlitMask(myLabel, 0, 0, 200, 30, false);

 

I get an error :

 

Error: addChildAt() is not available in this class. Instead, use addElementAt() or modify the skin, if you have one.

at spark.components::Group/addChildAt()[E]

at com.greensock::BlitMask/update()[D]

at com.greensock::BlitMask/set target()[D]

at com.greensock::BlitMask()[D]

 

can we have a workaround to make it work in Flex ?

 

Thanks in advance :)

Link to comment
Share on other sites

Ah, the joys of working with Flex :)

 

The problem has to do with some Flex components (Spark) that don't use standard DisplayObjectContainer methods for adding/removing children. Super frustrating. On top of that, Flex requires that any objects that are added to components as children be UIComponents (extend that class). Fun! (...NOT)

 

It should be possible to create a separate FlexBlitMask class that's for Flex, but I'm not sure yet if I'm going to do that. I'm on vacation at the moment, so I can't do anything until next week anyway. If anyone else needs BlitMask for Flex, please chime in here and cast your vote. If there's enough demand, I'll probably take a crack at it.

Link to comment
Share on other sites

It should be possible to create a separate FlexBlitMask class that's for Flex.

 

that will be very kind of you :roll:

 

Flex become more and more popular in the RIA world .

Link to comment
Share on other sites

  • 1 month later...

I definitely need. If I was not already a member, I would pay for this :-)

 

Please do Jack!

Link to comment
Share on other sites

  • 2 weeks later...

Okay, due to popular demand, I just posted a FlexBlitMask class in the downloads that extends UIComponent instead of Sprite and implements a few other necessities in order to be Flex-friendly. The ASDocs are at http://www.greensock.com/as/docs/tween/ ... tMask.html.

 

Get the code at

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×