Jump to content
Search Community

Hokeypokey

Members
  • Posts

    3
  • Joined

  • Last visited

Hokeypokey's Achievements

0

Reputation

  1. Hey, thank you so much for your help. I got the whole thing working. I hope that I can ask you one further question concerning the whole thing If I click on a project, the whole set of projects moves at the desired position but only for one time. If I click on another project after that it wont move again. Can I start each tween only once? My goal is to move every single project clicked (in connection with all of the other projects) to a predefined position, independently from their actual position. That requires that I can click on a project at any time and the timelinetween fires every time again. I tried to add timeline.restart(); at the end of the for loop, but in that case the movement is not smooth at all. I have attached the fla file this time. My code looks like that: //Setup Tweenmax import com.greensock.*; import com.greensock.easing.*; //-------------------------- var projects_counter:Number = 0; var max:Number = 10; var timeline:TimelineMax = new TimelineMax(); function move() { for ( var s = 1; s < max; s++ ) { //timeline.insert( TweenMax.to(target, time, {attribute to be tweened, ease} timeline.insert( TweenMax.to(_root["project"+(projects_counter+1-s)], (1/((1/s)+1)), {_y:100-(s*35), ease:Circ.easeOut})); timeline.insert( TweenMax.to(_root["project"+(projects_counter+s)], (1/((1/s)+1)), {_y:100+((s-1)*35), ease:Circ.easeOut})); //Move the (with an index >= the clicked one) projects up } timeline.play() } _root.project1.onPress = function() { projects_counter = 0; move(); } _root.project2.onPress = function() { projects_counter = 1; move(); } _root.project3.onPress = function() { projects_counter = 2; move(); } //----------------------- OLD FUSE CODE BELOW ------------------------- /* //Setup and register with Zego Engine import com.mosesSupposes.fuse.*; ZigoEngine.simpleSetup( Shortcuts, PennerEasing, Fuse ); //----------------------------------------------------------- //Setup Variables var projects_counter:Number = 0; var max:Number = 10; //----------------------------------------------------------- function move() //starts the movement of all projects, y:"movement target in absolute coords") { for ( var s = 1; s < max; s++ ) { var f:Fuse = new Fuse (); f.push ([ {target: _root["project"+(projects_counter+1-s)], y: 100-(s*35), time: 1+(1/((1/s)+1)), ease:"easeOutQuint"}, //move all elements with smaller index than the clicked one {target: _root["project"+(projects_counter+s)], y: 100+((s-1)*35), time: 1+(1/((1/s)+1)), ease:"easeOutQuint"} //move all elements with higher index and including the clicked one ]); f.push( {func:open, scope:this} //starting "open" ); f.start(); } } */ stop(); Can you help me once more? Christian
  2. Hi folks, I am currently translating my AS2 code from Fuse to Tweenmax and must say, that Tweenmax is really cool! Unfortunately I am having problems with some some commands. I hope that someone here can help me out. I want to translate the following Fuse code to a Tweenmax-code: function move() //starts the movement of all projects, y:"movement target in absolute coords") { for ( var s = 1; s < max; s++ ) { var f:Fuse = new Fuse (); f.push ([ {target: _root["project"+ s], y: 100-(s*35), time: 1+(1/((1/s)+1)), ease:"easeOutQuint"}, //move all elements with smaller index than the clicked one ]); } } I got the tweening working, but I dont know how to translate the targets into the Tweenmax code. I have some movieclips called project1, project2, project3, … , projectn that I want to tween. How can I add the "["project" + s)]" into Tweenmax-code, so that I can target all of the projects via the for-loop after each other. Hmm, I hope you understand, what I mean. My current Tweenmax code: function move() //starts the movement of all projects, y:"movement target in absolute coords") { for ( var s = 1; s < max; s++ ) { var timeline:TimelineLite = new TimelineLite(); timeline.insertMultiple( TweenMax.allTo("project" + s, 1, {_y:100-(s+20), ease:Quint.easeOut}, 0.1)); } } This code is not working Please help me, I am at my wits end. Many thanks in advance. Chris
×
×
  • Create New...