Jump to content
Search Community

VisiblePlugin should set visible to true at the beginning

TyZ test
Moderator Tag

Recommended Posts

The VisiblePlugin set the visibility at the end of a tween. But shouldn't it make more sense if this would only occur if you want to set visible to false? If you set the visible to true it should be set at the beginning of the tween (but after the delay).

 

Example:

Note the following tween:

 

mc.visible = false;
mc.x = 0;
TweenMax.to(mc, 1, {delay: .5, x: 300, visible: true});

 

What I expect to happen:

- mc is not visible at the beginning

- after 0.5 seconds the mc appears and tweens from x 0 to x 300 in 1 second.

 

But what does happen:

- mc is not visible at the beginning

- after 1.5 seconds mc appears at x 0

 

 

I also already discovered a workaround for this:

 

mc.visible = false;
mc.x = 0;
TweenMax.to(mc, 1, {delay: .5, x: 300, autoAlpha:1});

 

This does exactly what I need. But I think this should also happen when you use the VisiblePlugin.

Link to comment
Share on other sites

When using a TweenMax.to() the properties that you set are target / end / destination properties so setting a property there for the beginning of the tween would be counter-intuitive to the entire TweenMax/Lite model.

 

the following should suit your situation

 

box.visible = false;
TweenMax.fromTo(box, 1, {visible:true}, {x:300, delay:2});

 

the box will start invisible

after 2 seconds it will appear and tween its x.

 

thanks for bringing this up, I never used the visible plugin before and it I can see it can come in quite handy!

Link to comment
Share on other sites

  • 3 years later...

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