Jump to content
GreenSock

MrMiyagi

problem with timelinemax and texteffects.

Recommended Posts

Hello,

 

I am developing a flash presentation that has a background picture slideshow with fade effect and text with effects. I am using timelinemax, splittextfield and some tweenmax effects.

 

My problem is that I can not seem to get this text effect work inside a timeline:

timeline.insert(TweenMax.allFrom(stf.textFields, 1, {y:"-100", autoAlpha:0, ease:Elastic.easeOut}, 0.05));

 

I get this error message:

1067: Implicit coercion of a value of type Array to an unrelated type com.greensock.core:TweenCore.

 

if i add that line of code outside the timeline, it works ok.

 

I would also like to know what all you experienced coders think of my code and could it be done better. All tips are welcome. Here it is:

 

import com.greensock.*;
import com.greensock.TweenMax;
import com.greensock.text.SplitTextField;
import com.greensock.easing.*;
import com.greensock.plugins.*;


var timeline:TimelineMax = new TimelineMax({repeat:-1, yoyo:false, repeatDelay:0.3});
var stf:SplitTextField = new SplitTextField(this.pic1_mc.pic1text);


//timeline starts
timeline.insert(TweenMax.allFrom(stf.textFields, 1, {y:"-100", autoAlpha:0, ease:Elastic.easeOut}, 0.05));
timeline.append( TweenLite.to(pic1_mc, 1, {delay:8, alpha:0}) );

//applying splittextfield to the same text that was brougt on stage with Tweenmax elastic.easeout.
for (var i:int = stf.textFields.length - 1; i > -1; i--) {
timeline.insert(
TweenMax.to(stf.textFields[i], 2, 
{blurFilter:{blurX:10, blurY:10}, x:Math.random() * 650 - 100, y:Math.random() * 350 - 100, scaleX:Math.random() * 4 - 2, 
            scaleY:Math.random() * 4 - 2, rotation:Math.random() * 360 - 180, autoAlpha:0, delay:6, ease:Quad.easeIn, 
			repeat:0, repeatDelay:1.2}) 
			  );}


//Fading tha backgroundpictures. More text with effects will be added on top of these pictures.
timeline.append( TweenLite.to(pic2_mc, 1, {delay:5, alpha:0}) );
timeline.append( TweenLite.to(pic3_mc, 1, {delay:5, alpha:0}) );
timeline.append( TweenLite.to(pic4_mc, 1, {delay:5, alpha:0}) );
timeline.append( TweenLite.to(pic5_mc, 1, {delay:5, alpha:0}) );
timeline.append( TweenLite.to(pic6_mc, 1, {delay:5, alpha:0}) );
timeline.append( TweenLite.to(pic7_mc, 1, {delay:5, alpha:0}) );
timeline.append( TweenLite.to(pic8_mc, 1, {delay:5, alpha:0}) );
timeline.append( TweenLite.to(pic9_mc, 0, {delay:5, alpha:1}) );
//fades back to the first picture and restarts the timeline.
timeline.append( TweenLite.to(pic1, 1, {alpha:1}) );

 

 

I have 9 movieclips with pictures and dynamic text fields on different layers and trying fading those with tweenlite. The final banner should be a presentation of pictures and text effects on top of them.

 

Thanks for help. Greensock rules!

Link to comment
Share on other sites

My problem is that I can not seem to get this text effect work inside a timeline:

timeline.insert(TweenMax.allFrom(stf.textFields, 1, {y:"-100", autoAlpha:0, ease:Elastic.easeOut}, 0.05));

 

I get this error message:

1067: Implicit coercion of a value of type Array to an unrelated type com.greensock.core:TweenCore.

 

That's because TweenMax.allFrom() returns an Array - you need to use insertMultiple() instead of insert(). insert() is for inserting a single tween.

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