Jump to content
Search Community

TimelineLite driving me Crazy

copperjohn test
Moderator Tag

Recommended Posts

Hi I'm experiencing very weird time with timelinelite.. it seems it changes behavior every time I compile...

 

Hi have a clip on stage -> this clip has 3 movieclip inside :

-> _sfondo

->_testo

->_highlight

 

I have exported this mc and on propertye I have linked with a custom class

 

 

in this custom class i do this:

 

package com.aktivo.afterpixel
{

import flash.display.*;
import flash.events.*;
import com.greensock.*;
import com.greensock.easing.*;
import com.greensock.plugins.*;

public class bottoneTondoOne extends MovieClip {

	public var _sfondo:MovieClip;
	public var _testo:MovieClip;
	public var _highlight:MovieClip;
	var _timeline:TimelineLite = new TimelineLite();

	public function bottoneTondoOne():void {

		//this.mouseChildren = false;
		this.useHandCursor = true;
		this.buttonMode = true;			
		this.addEventListener(MouseEvent.CLICK, onRollover);

		_timeline.append(new TweenLite(_sfondo, 1, {scaleX:1.6, scaleY:1.6, ease:Elastic.easeOut}));
		_timeline.insert(new TweenLite(_testo, 1, {tint:0x000000}));
		_timeline.insert(new TweenLite(_highlight, 1, {x:250}));
		_timeline.append(new TweenLite(_sfondo, 1, {scaleX:1, scaleY:1, ease:Elastic.easeOut}));
		_timeline.insert(new TweenLite(_testo, 1, {tint:0xFFFFFF}), 0.5);
		_timeline.insert(new TweenLite(_highlight, 1, {x:-250}));
		_timeline.stop();
	}

	private function onRollover(event:MouseEvent):void {

		_timeline.restart();

	}
}
}

 

_highlight DOESN'T MOVE!!! (.. just sometimes and I don't know why)

_testo goes black (0x000000) the first time i click on the mc but then it remains white...

 

please help

 

Francesco

Link to comment
Share on other sites

You're setting up your tweens incorrectly. The way you're timing them causes conflicts. For example, you have 1 tween telling _highlight to go to x:250 and another tween running at the SAME TIME telling _highlight to go to x:-250! You have a tint tween that starts going but 0.5 seconds later (halfway through it), there's another tint tween of the same object telling it to go to a different tween.

 

Remember, the default insert() time is 0. You didn't define any insertion time parameter for your insert() calls, so they're all starting at the beginning of the timeline The ones you append() will of course get added to the end. Please watch the video at http://www.greensock.com/timeline-basics/ to get a better understanding of how TimelineLite and TimelineMax work.

 

Hope that helps.

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