Jump to content
GreenSock

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

Set Queue's Alpha

Recommended Posts

Is there any way to set the alpha of an entire queue to 1 instead of individually setting them?

 

For instance:

var queue:LoaderMax = new LoaderMax({ name: 'queue', onComplete: display });
				
				queue.append(new ImageLoader('image1.png', { width: 112, height: 107, x: 502, y: 426, bgColor: 000000, scaleMode: 'proportionalInside', alpha: 0, container: this }));
				queue.append(new ImageLoader('image2.png', { width: 112, height: 107, x: 746, y: 426, bgColor: 000000, scaleMode: 'proportionalInside', alpha: 0, container: this }));
				queue.append(new ImageLoader('image3.png', { width: 112, height: 107, x: 990, y: 426, bgColor: 000000, scaleMode: 'proportionalInside', alpha: 0, container: this }));
				queue.append(new ImageLoader('image4.png', { width: 112, height: 107, x: 1234, y: 426, bgColor: 000000, scaleMode: 'proportionalInside', alpha: 0, container: this }));

Obviously there are more than 4 images being loaded but this is just for example.

Link to comment
Share on other sites

Well, you could certainly just loop through the content like:

var content:Array = queue.content; //returns an array of ContentDisplay objects if they're all ImageLoaders or SWFLoaders
for (var i:int = 0; i < content.length; i++ ) {
    content[i].alpha = 0;
}

Or if you've got v12 of the tweening platform, you should be able to do this:

TweenLite.set(queue.content, {alpha:0});

Is that what you were looking for? 

Link to comment
Share on other sites

That's absolutely perfect! Thanks for the quick response.

 

When did v12 release? I have TweenMax but not TweenLite unfortunately.

Link to comment
Share on other sites

Hmm not sure of the exact date, but v12 has been available for over a year :lol: and it's kind of great.

 

TweenMax extends TweenLite, so if you have TweenMax available, you will also have access to TweenLite. There's no harm in using TweenLite after importing TweenMax, unless your tween needs to use a specific feature of TweenMax like repeat, yoyo etc.

Link to comment
Share on other sites

Good to know, thanks.

 

I'll give the TweenLite import a try.

Link to comment
Share on other sites

Just to clarify, if you import TweenMax into the page, then TweenLite is automatically available - no extra import required.

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