Jump to content
Search Community

Tween: Property backgroundAlpha not found on mx.containers.VBox and there is no default value.

San Kumar test
Moderator Tag

Recommended Posts

Hi,

 

I have a very simple application where I want to tween the `backgroundAlpha` of a VBox using TweenLite.

 

I'm using the following code:

TweenLite.to(box1, 2, {backgroundAlpha:0.4});

But when I try to run my movie, I get the following error:

Property backgroundAlpha not found on mx.containers.VBox and there is no default value.

I'm guessing it is because backgroundAlpha is set using `setStyle` not directly... so that is causing the issue?

 

So how do you do it in TweenLite or TweenMax to set it?

 

Thanks for your replies..

 

San

Link to comment
Share on other sites

You could use a proxy object and an onUpdate:

var styles:Object = {backgroundAlpha:box1.getStyle("backgroundAlpha")};
TweenLite.to(styles, 2, {backgroundAlpha:0.4, onUpdate:function() {
    box1.setStyle("backgroundAlpha", styles.backgroundAlpha);
}});

Or create your own plugin that manages that stuff for you. 

  • Like 1
Link to comment
Share on other sites

Unfortunately we generally don't accept pull requests because:

  1. We have to stand behind whatever we offer to the community, so we must be intimately familiar with every line of code. 
  2. Our licensing model requires that we make certain promises to our customers regarding authorship and protect them from IP infringement issues. Pull requests make that much more difficult or outright impossible. 

That being said, we do welcome pull requests for the purpose of seeing suggestions and ideas. Even if we don't merge the changes into our codebase, pull requests are great for communicating what you'd like to see in our toolset and sharing your approach. 

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.
×
×
  • Create New...