Jump to content
Search Community

Hippiesvin

Members
  • Posts

    28
  • Joined

  • Last visited

Everything posted by Hippiesvin

  1. Hi GreenSock - and thank you for your quick reply, you are really doing a great job Previewing after copying and pasting your code into a new flash project throws 1 error back from the compiler. Compiling in strict mode throws 3 errors. The errors are located in the var sequence:TweenGroup...... Any idea why? I've checked for missing commas and so. /Hippiesvin
  2. I have been trying to find examples on how to draw shapes and lines using TweenMax, and haven't been able to find any. So I thought I might not be the only one needing some expert advice on this subject. I found my own way drawing a simple retangle, where each sideline get's animated using the onUpdate:Function, so you actually see the retangle being drawed. My problem is though, that my method seems to be a little unstabil especially when I speed up the drawing. Question: Is there an easier/better way to draw lines and shapes with TweenMax than my example below? // CODE ==================== import fl.motion.easing.*; import flash.display.*; import gs.TweenMax; import gs.easing.*; var line:Shape = new Shape(); line.graphics.lineStyle(10, 0xFFD700, 1, false, LineScaleMode.VERTICAL, CapsStyle.NONE, JointStyle.MITER, 10); this.addChild(line); line.x = 50; line.y = 50; var Drawer:Sprite = new Sprite(); this.addChild(Drawer); TweenMax.to(Drawer, 0.1, { delay: 0, x:200, ease:Quadratic.easeOut, onUpdate:drawLine }); TweenMax.to(Drawer, 0.1, { delay: 0.1, y:100, ease:Quadratic.easeOut, onUpdate:drawLine }); TweenMax.to(Drawer, 0.1, { delay: 0.2, x:0, ease:Quadratic.easeOut, onUpdate:drawLine }); TweenMax.to(Drawer, 0.1, { delay: 0.3, y:0, ease:Quadratic.easeOut, onUpdate:drawLine }); function drawLine() { var X:int = Drawer.x; var Y:int = Drawer.y; line.graphics.lineTo(X, Y); } // END CODE ====================
  3. The "Multiple targets" explanation was excactly what I was looking for Had a love affair with fuse, but TweenMax has marriage potential. This code works for me: 1 . Scaling sprite PImage01 up and at the same time calling function Alpha to alpha down an array of sprites to 0.5. 2 . Scaling sprite PImage01 down and at the same time calling the same function Alpha to alpha an array of sprites back up to 1. function Alpha(Avalue:Number,Aid:String) { var A:Array; if (Aid == "A1") A = new Array(PImage02,PImage03,PImage04,PImage05,PImage06,PImage07,PImage08); TweenMax.allTo(A, Number(1.0), { alpha:Number(Avalue), ease:Quadratic.easeIn, overwrite:false }); } var D:Number = 0; TweenMax.to(PImage01, 1.0, { delay: D, scaleX:1.2, scaleY:1.2, ease:Quadratic.easeInOut, overwrite:false, onStart:Alpha, onStartParams:[0.5,"A1"] }); TweenMax.to(PImage01, 1.0, { delay: D+=4, scaleX:1.0, scaleY:1.0, ease:Quadratic.easeInOut, overwrite:false, onStart:Alpha, onStartParams:[1,"A1"] }); thank U TweenMax. Hippiesvin
×
×
  • Create New...