Jump to content
GreenSock

HyperNerd

VideoLoader Visibility True/False

Recommended Posts

Sorry for all the questions...just trying to learn!

 

So, now I am attempting to set VideoLoader visibility true/false.

 

mainVideo = new VideoLoader("path", { name:"mainVideo", container:this, bgColor:0x000000, scaleMode:"proportionalInside", autoPlay:true} );
mainVideo.visible = false;

 

Obviously, it's not working:

Cannot create property visible on com.greensock.loading.VideoLoader

 

How does one utilize a similar visibility feature with VideoLoader?

Link to comment
Share on other sites

Figured this one out... by embracing TweenLite, of course!

 

TweenLite.to(mainVideo.content, 0, {alpha:0});

...

TweenLite.to(mainVideo.content, 0, {alpha:1});

Link to comment
Share on other sites

Should be able to do this with mainVideo.content.visible. You can also set visible in the initial vars object if that's easier.

mainVideo = new VideoLoader("path", { name:"mainVideo", container:this, bgColor:0x000000, scaleMode:"proportionalInside", autoPlay:true, visisble: false} );

 

According to the api content is a ContentDisplay Sprite so it will have a visible property.

Link to comment
Share on other sites

Oh got distracted and didn't realise you'd already answered it yourself.

 

mainVideo.content.alpha = 0; would do the trick as well. You might find it handy however to tween autoAlpha to get visible toggling as well.

TweenLite.to(mainVideo.content, 0, {autoAlpha:1});

  • Like 1
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.
×