Jump to content
GreenSock

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

Removing Split Text Field on Timeline Stop

Recommended Posts

Hello,

 

I am having a little bit of trouble finding a way to remove the split text field from a textfield once I stop the animation its in.

 

Long story short, I made a library which creates little timelines (sub-animations) for each animation (a timelineMax for flashing text, one for bouncing text, etc.).  I give the end user the ability to combine all these little tiimelines into one big timeline, so that they may do something like the following:

 

Text fades in, text flashes, text spins, text slides off screen

 

All is working fine until one point.  If one of those sub-animations uses a Split Text Field for its operation and the end user clicks the stop button before that sub-animation completes, the Split Text Field stays on the textField and I cannot find a way to remove it (usually the textField disappears).

 

If needed, I can provide some code but I have a sneaky suspicion that there is a very simple and already completed solution for this exact issue.

 

I can say that I do the following whenever the "stop" button is clicked as an attempt to fix the issue:

(These are applied to the 'master' timeline)

 

timeline.stop();
timeline.seek(0);
timeline.clear(true);
TweenPlugin.activate([blurFilterPlugin]);
TweenMax.to(target,0,{blurFilter:{remove:true}});
 
Thank you in advance for your assistance!
 
 
 
 
 
Link to post
Share on other sites

Hi,

 

Not exactly sure I follow your description, but I would start with trying the deactivate() method:

 

 

If that doesn't work please post a very simple example, preferably without use of your library, just an example that we can use to focus on what should happen when a timeline stops. Thanks

Link to post
Share on other sites

Hello Carl,

 

Thank you very much for the help!

 

You're answer was exactly what I needed.  Just an FYI for anyone else who comes across a similar issue, my final solution was to extend the timelineMax with an object which I called enhancedTimelineMax.

 

This object simply kept a pointer to the SplitTextField used on each animation.

I replaced all my timelineMax objects within my library with this class.

 

 

 

 

 

When the end user clicks stop, I used the getChildren() on the masterTimeline and search for any objects which were enhancedTimelineMax and stated something to the following:

 

foundEnhancedTimelineMaxObject.pointerToSplitTextField.deactivate();

 

 

If what I said above is confusing let me know and I will post some code and further explanations.

 

Thank you again for all the help, its a super relief to get such great support.  Makes though projects move forward.

Link to post
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.

×