Jump to content
Search Community

TweenMax.allFrom default alpha:0 to 1?

bonassus test
Moderator Tag

Recommended Posts

I have a bit of confusion here. I set all the movieClips alpha property to 0 as soon as they are added to the stage. section7Tl:TweenMax.allFrom alpha:0 tweens their alpha to 1. which confuses me but does what I want. when section8Tl:TimelineMax starts their alpha goes back to 0. At lease I assume it does as it is no longer displayed. what is going on here. does allFrom default alpha:0 to 1? do I have to set these movieClips.alpha to 1 section7Tl.onComplete? Or am i just confused again?

Thanks A lot!

 

tl = new TimelineMax( {} );
var section7Tl:TimelineMax = new TimelineMax({onComplete:onStop});
section7Tl.appendMultiple(TweenMax.allFrom([vthumb1 ,vthumb2 ,vtrack1 , vtrack2 ,vAreaBar, vAreaBar2],globalTweenTime, {transformAroundCenter:{scaleX:0, scaleY:0}, alpha:0, ease:_model.theEase}, globalStagger));
tl.append(section7Tl);

var section8Tl:TimelineMax = new TimelineMax({onComplete:onStop});
section8Tl.insertMultiple(TweenMax.allTo([hNumberBox1, hNumberInput1,vNumberBox2, vNumberInput2 ],globalTweenTime, {alpha:0, ease:_model.theEase}));
tl.append(section8Tl);
}

Link to comment
Share on other sites

i'm not understanding exactly why it is behaving how you describe.

 

if you are putting the clips on stage with an alpha of 0, an allTo() with alpha:1 should work fine.

 

if you start with alpha= 0 and the tween from alpha 0... there is nothing to tween.

 

you would only need to use allFrom alpha:0 if the alpha wasn't previously set to 0.

 

are you adding your clips to the display list and setting their alpha before or after the timeline is created?

 

also keep in mind that allFrom() tweens have their immediateRender value set to true, which (depending on the order things are happening) may cause some things to happen that you aren't expecting.

 

if you want to post an fla with just this behavior illustrated feel free to save as Flash CS5 and attach as a zip.

 

thanks

 

c

Link to comment
Share on other sites

Thanks for your response.

I set this project up in kind of a weird way. all the clips start out on the stage. There a little as3 on frame one that sets all the objects alpha to 0

 

for (var i:uint = 0; i < this.numChildren; i++){
this.getChildAt(i).alpha = 0;
}

 

then i'm showing the clips with

 

var section0Tl:TimelineMax = new TimelineMax({onComplete:onLabelStop});
section0Tl.appendMultiple(TweenMax.allFrom([m.buda,m.topWindow],globalTweenTime, {transformAroundCenter:{scaleX:0, scaleY:0}, alpha:0,ease:_model.theEase}, globalStagger));
tl.append(section0Tl);

 

this shows the clips which confuses me because i didn't set an alpha to. does immediateRender affect the alpha?

I guess it's the weird way i set this file up but it was really convenient for positioning clips

I could post the fla and all the classes if that would help

 

Thanks!

Link to comment
Share on other sites

it was immediateRender.

 

appendMultiple(TweenMax.allFrom([vthumb1 ,vthumb2 ,vtrack1 , vtrack2],1,{ alpha:0,immediateRender:true}));

 

this tweens the clips from 0 alpha (which they already were at) to alpha:1 or at least rendered on screen. And when the timeline moves on they disappear.

with immediateRender:false. they stay on screen when the timeline moves forward.

immediate render must set alpha.

Link to comment
Share on other sites

glad you got it figured out. thanks for letting us know.

 

immediateRender applies to all the properties in that particular tween. just want to make it clear that allFrom or immediateRender don't do anything to the alpha "by default".

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