Jump to content
Search Community

how to get the target of THIS tweenMax

biyibird test
Moderator Tag

Recommended Posts

	var _arr:Array = [];
	public function test_allto()
	{
		_arr.push( TweenMax.to(mc1,1,{rotation:180,scaleX:0.1,scaleY:0.1,delay:0,onComplete:onCompleteH, paused:true}));
		_arr.push( TweenMax.to(mc2,1,{rotation:180,scaleX:0.1,scaleY:0.1,delay:0,onComplete:onCompleteH, paused:true}));
		_arr.push( TweenMax.to(mc3,1,{rotation:180,scaleX:0.1,scaleY:0.1,delay:0.5,onComplete:onCompleteH, paused:true}));
...............

 

              public function onCompleteH()
	{
		/////////////////////my question:how to get the target of THIS tweenMax ? if there's no "mytween="......
		//thisTarget.currentProgress = 0;
		//thisTarget.pause();
	}

Link to comment
Share on other sites

use TweenMax's onCompleteListener

 

 

 

import com.greensock.*;
import com.greensock.easing.*;

//*** MUST import TweenEvent 

import com.greensock.events.TweenEvent;



TweenMax.to(mc, 1, {y:100, onCompleteListener:done});

function done(event:TweenEvent):void{
trace(event);
trace(event.target); //the tween
       trace(event.target.target) // the target of the tween
        event.target.currentProgress = .5;
}

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