Jump to content
Search Community

flasp

Members
  • Posts

    6
  • Joined

  • Last visited

flasp's Achievements

0

Reputation

  1. Thanks, but then how do I make sure that point is seperated for each animation-initiation.
  2. This is the same problem for TimelineMax and LinePath2D. I simply cant get dynamically created timelines or paths to seperate like movieClips would. In the example below I end up with one long path, which both shapes follows. What I need is the xml-generated paths to seperate, but what is the solution to that. import com.greensock.*; import com.greensock.easing.*; import com.greensock.motionPaths.*; import flash.geom.Point; var s:Shape = new Shape(); s.graphics.beginFill(0xFF0000, 1); s.graphics.drawRect(-10 / 2, -10 / 2, 10, 10); s.graphics.endFill(); addChild(s); var k:Shape = new Shape(); k.graphics.beginFill(0x0000FF, 1); k.graphics.drawRect(-10 / 2, -10 / 2, 10, 10); k.graphics.endFill(); addChild(k); var points:Array=new Array(); var pointXML:XML= 0,0 100,100 320,150 550,400 300,30 250,100 380,150 50,400 ; function addMovement(mc,num,path:LinePath2D){ for each(var tmp:XML in pointXML.pointsettings[num].point) { var point:Array=tmp.toString().split(','); points.push(new Point(point[0],point[1])); } path = new LinePath2D(points); path.addFollower(mc); TweenMax.to(path, 20, {progress:2}); addChild(path); } var path0; var path1; addMovement(s,0,path0); addMovement(k,1,path1);
  3. at onComplete I need to add the name of the movie being tweened so the next append can be started. But that takes that there is a parameter to myFunction. Ive simply tried adding one, but with no luck. How can I get around this. I need this because the tween-settings comes from xml and is of unknown length and therefore added by the increasing of a number (see snippet). var animXML:XML= xyxrotationY var animateArray=animXML.animation[0].animate; function animation(mc){ anim = animateArray[nim].text(); animArray=anim.split(','); for (i = 0; i < animArray.length; i++){ objectProperty= animArray[i].split(':'); propertyName = objectProperty[0]; propertyValue = objectProperty[1]; tween[propertyName] = Number(propertyValue); } tl = new TimelineMax({onComplete:myFunction}); tl.append(new TweenLite(mc, 2, tween)); } function myFunction(mc){ nim=nim+1; if (nim<=animateArray.length()-1){ animation(mc); } } animation(green);
  4. I am entering data to a timelineMax-tween from CDATA, but has a problem with alpha. The alpha-effect does not take place. In no form. All other effects like x, y, scaleX, scaleY, rotation, delay,rotationY and so on seems to work. What am I missing here. Other irregularities: When appending from CDATA the properties adds to the current position, it does not go to the actual position. Imagine both tweens comes from CDATA: tween1=x:400; tween2=x:200; tl.append(new TweenLite(green, 2, tween1)); tl.append(new TweenLite(green, 2, tween2)); then the movie green will end in posion x:600;
  5. That works just perfect. Thanks alot.
  6. I trying to initiate a timeLineMax-tweening through xml, but cant make it work (see snippet); Im getting these errors, that Im not sure what to make of. 1084: Syntax error: expecting colon before rightbrace. 1084: Syntax error: expecting identifier before rightbrace. How do initiate the tween though xml. import com.greensock.* import com.greensock.easing.* var animXML:XML= x var tween=animXML.animate.text(); var tl:TimelineMax = new TimelineMax(); tl.append(TweenLite.to(green, 2, {tween}));
×
×
  • Create New...