Jump to content
Search Community

Can't get TintPlugin to work

kamcknig test
Moderator Tag

Recommended Posts

Hi all,

 

I've used the TintPlugin before and gotten it to work, so I can't understand why I can't get it to work now :/

 

I have a Main class and in there I activate the plugin:

import com.greensock.plugins.TintPlugin;
import com.greensock.plugins.TweenPlugin;
import com.greensock.TweenLite;

public class Main extends MovieClip {
 public function Main() {
   TweenPlugin.activate([TintPlugin]);
 }
}

 

Then I have a class called Country that I'm trying to change the tint of a MovieClip inside of Country:

import com.greensock.easing.*;
import com.greensock.TweenLite;

public class Country extends MovieClip {
 public var outline:MovieClip;
 public var fog:MovieClip;

 public function Country() {
 }

 public function set color(val:Number):Void {
   var tintTween:Object = new Object();
   tintTween.tint = val;
   tintTween.ease = Linear.easeNone;
   TweenLite.to(this.outline, 1, tintTween);
 }
}

 

 

This, however, does not work. The color of the outline MovieClip just stays it's default color!

 

Does anyone see anything wrong or have suggestions?

 

Thanks!

Kyle

Link to comment
Share on other sites

Sorry, ignore my previous post - I didn't see your first block of code. Anyway, it looks like it should work fine - could you post an FLA that demonstrates the issue? There must be something else going on in your code. The value you're passing for the tint is a uint, right?

Link to comment
Share on other sites

This isn't a simplified FLA that isolates the problem - sorry, I just don't have time at the moment to dig through all the code. I can try to later when my schedule opens up a bit, but if you want a faster answer, please create a separate FLA that has only enough code/assets to replicate the issue. I find that this is a very helpful best practice anyway when you're trying to troubleshoot something. See if you can do a single tint tween in an FLA. If you can, start to build on that and slowly introduce complexity until it breaks. Then you can see exactly where the issue is.

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...