kk firstly i want to say thank you for all your work,
secondly plz don't look my english it pretty bad
the code all is in a class.as :
// my var i use in this example
public var tweenContainer:TimelineMax;
// the function create each movieclip and build it
public function constructProduct(productType:Number, trackNumber:Number):void {
var array1:Array = new Array("0","_product_1","_product2","_product_3","_product_4","_product_5");
var array2:Array = new Array("0","product_1","product_2","product_3","product_4","product_5");
var maClass:Class = getDefinitionByName(array2[productType]) as Class;
var monClip:MovieClip = new maClass();
monClip.buttonMode = true;
monClip.x = 100 + (25*trackNumber);
monClip.y = -(25*trackNumber);
monClip.addEventListener(MouseEvent.MOUSE_DOWN, dragProduct);
monClip.addEventListener(MouseEvent.MOUSE_UP, stopDragProduct);
monClip.name = array1[productType];
this.array3[trackNumber].addChild(monClip);
// my famous time line
tweenContainer = new TimelineMax();
tweenContainer.append( new TweenMax(monClip, 1, {y:(300 - (25*trackNumber)), ease:Bounce.easeOut}) );
tweenContainer.append( new TweenMax(monClip, 5, {x:(850 + (25*trackNumber)), ease:Linear.easeNone}) );
}
//function event we just need the drag function for this exemple
private function getPosition(target:Object):void {
xPos = target.x;
yPos = target.y;
}
public function dragProduct(e:MouseEvent):void {
tweenContainer.pause();
getPosition(e.target);
e.target.startDrag(true);
}
all work fine, the animation animate each movieclip, the only problem i have ( and it not related to the timeline itself ) but to how call specific one or (probably more the solution) how build dynamic time line.
i want when you click on a product (monClip) the animation stop for this product, now he stop the last timeline call (it normal because they have all the same identifier). also im not obligatory to be a timlinemax, i can do two tweenMax with one with delay, if the solution with simple tweenMax is more easy
if in not enough clear i can describe more about what i expect to have in this function.
thanks you very much in advance,
Alex Grenier