Jump to content
Search Community

SplitTextField - how to run as a sub Tween?

mspanish test
Moderator Tag

Recommended Posts

Yet another newbie inquiry!

 

My timeline, which works awesome - looks like this:

 

var timeline:TimelineMax = new TimelineMax({paused:false, overwrite:false});  
var tween:TweenMax = null;  
timeline.append(TweenMax.from(page1, 5, {autoAlpha:0,  onInit:initSlide1} ) ); 
timeline.addLabel("page1", timeline.duration) 
timeline.append(TweenMax.from(page2, 4, {x:0, y:0, autoAlpha:0, onInit:initSlide2})); 
timeline.addLabel("page2", timeline.duration) 
timeline.append(TweenMax.from(page3, 10, {x:0, y:0, autoAlpha:0,  onInit:initSlide3})); 
timeline.addLabel("page3", timeline.duration) 
timeline.append(TweenMax.from(page4, 5, {x:0, y:0, autoAlpha:0, onInit:initSlide4})); 
timeline.addLabel("page4", timeline.duration) 
timeline.append(TweenMax.from(page5, 10, {x:0, y:0, autoAlpha:0,  onInit:initSlide5, onComplete:timeStop})); 
timeline.addLabel("page5", timeline.duration)  

 

I'm trying to add a letter by letter animation for each field, beginning with the first entry, page1.

 

I tried adding this instead of the first 2 entries in the timeline:

 

 

var page1string:SplitTextField = new SplitTextField(string1_txt, SplitTextField.TYPE_WORDS);

timeline.append(TweenMax.from(page1, 5, {autoAlpha:0,  onInit:initSlide1} ) ); 
timeline.addLabel("page1", timeline.duration) 
timeline.insertMultiple(TweenMax.allFrom(page1string.textFields, .8, {alpha:0, delay:1.2, onComplete:page1string.deactivate }, 0.1));

 

Seems this should work! Anybody dealt with this before? Thanks so much in advance...

Link to comment
Share on other sites

Hi mspanish,

I'm a bit confused with what it is you're trying to tween.

You have page1-5 tweend in your original code, but then in the replaced code you turn "string1_txt" into a SplitTextField, as well as the page1-5 mc's.

What is "string1_txt" and the actual problem?

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