Jump to content
Search Community

goonzy

Members
  • Posts

    11
  • Joined

  • Last visited

goonzy's Achievements

0

Reputation

  1. I think I'm starting to have te result I'm after. still having small "timing issues" in the Timeline loop but I'm getting there using the labels thanks for your help
  2. I'm not sure to understand... (but I might be thick ) BAsically, I've got 66 objects to move to 66 positions (in my example) and with your example, if I change the destination MC to my Sprites array, it does not work the way I expect in my loop for (var j:int=0, i<66, i++{ tl.append(TweenMax.to(vballs[j], .2, {x:Bxxx[j], x:Byyy[j], x:Byyy[j]})); // Array where all coords are set to x:0, y:0, z:0 tl.append(TweenMax.to(vballs[j],.1, {x:Bx[j], y:By[j], z:Bz[j]})); // Array with obj 1 coords tl.append(TweenMax.to(vballs[j], .2, {x:Bxxx[j], y:Byyy[j], z:Bzzz[j]})); //0 tl.append(TweenMax.to(vballs[j],.1, {x:Bxx[j], y:Byy[j], z:Bzz[j]})); // Obj 2 All my objects go to the new coordinates, but one by one, while I'd like them to go all together. and the timeline does not take the new frames in account??? (I've put the values I use "hard" values)
  3. Hi all, I'm playing around with Away 3D (doing an well known oldskool fx.. Vectorbobs)... and basically, I'm trying to tween between 2 Objects and can't really find out what to do: My code for the moment just does a yoyo repeat from 0 to obj coordinates. What I would like to do is go from 0 origin -> Obj A -> 0 origin -> Obj B. heres my current code function initObjects():void{ var vballs:Array=new Array(); // Array containing all sprites // Arrays of X,Y,Z coordinates of sprites in 1st object var Bx:Array=[0,0,0,20,20,-20,-20,40,40,40,-40,-40,-40,80,80,80,80,-80,-80,-80,100,-100,-100,120,-120,-120,-120,140,140,140,-140,-140,180,180,-160,-160,-160,200,200,200,-200,-200,-200,-200,220,220,220,-220,-220,-220,240,240,-240,-240,-240,-260,-260,0,0,0,0,0,0,0,0,0]; var By:Array=[0,40,-40,40,-40,40,-40,20,0,-20,20,0,-20,20,0,-20,-40,20,0,-20,20,40,-40,20,40,0,-40,0,-20,-40,40,-40,0,-40,20,0,-20,20,0,-40,0,-20,-40,-60,20,-20,-40,20,-40,-80,20,-20,20,-40,-80,0,-20,0,0,0,0,0,0,0,0,0]; var Bz:Array= [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]; // Arrays of X,Y,Z Coordinates for Object B var Bxx=[20,-20,-20,-20,40,-40,-40,60,-60,-60,80,-80,-80,100,100,100,100,100,-100,-100,-100,-100,-100,120,120,120,120,120,-120,-120,-120,-120,-120,20,-20,-20,-20,40,-40,-40,60,-60,-60,80,-80,-80,100,100,100,100,100,-100,-100,-100,-100,-100,120,120,120,120,120,-120,-120,-120,-120,-120]; var Byy=[-20,20,0,-20,-40,40,-40,-40,40,-40,-40,40,-40,40,20,0,-20,-40,40,20,0,-20,-40,40,20,0,-20,-40,40,20,0,-20,-40,-20,20,0,-20,-40,40,-40,-40,40,-40,-40,40,-40,40,20,0,-20,-40,40,20,0,-20,-40,40,20,0,-20,-40,40,20,0,-20,-40]; var Bzz=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20]; trace (Bz.length); // Just to check there's the same amount of data in all Arrays // Creation of all the sprites needed. var i:int=0; while (i var ball:Sprite3D=new Sprite3D(); ball.material=spr_mat; ball.distanceScaling = false; view.scene.addSprite(ball); vballs.push(ball); vballs[i].x=Bxx[i]+25; vballs[i].y=Byy[i]-35; vballs[i].z=Bzz[i]+55; i++; } //1st tweening test.. Repeat yoyo with 1st object TweenMax.allFrom (vballs, 4, {x:0, y:0, z:0,repeat:-1, yoyo:true} ); // } Can someone help me on this as I'm not too "code litterate (and just understood the way arrays work ) Thanxx in advance
  4. I supposed so .. Ok so I wanted the 256 tween to last 0.02 seconds (1 frame) and I did not really figure out ou to append tweens in TimelineLite without writing 256 lines ... (told you I'm beginner;) an I thought that tweens had better timing handling than I could achieve with Enter Frames) but for simple things I guess I should stick to .x and .y you're right.
  5. I was testing as I found that the .x .y method was sometimes a bit "sluggish" and I was hoping I could do somthing like a while (i<256) tweenMax etc... without having to do the ENTER FRAME loop.
  6. hi I've tried this for testing purpose: import com.greensock.*; import flash.display.MovieClip; import com.greensock.easing.*; import flash.display.Bitmap; var clip:MovieClip=new MovieClip(); var busy_data:busy=new busy(0,0); var busy_bmp:Bitmap=new Bitmap(busy_data); clip.addChild (busy_bmp); addChild(clip); var sin = [25, 24, 23, 23, 22, 21, 21, 20, 20, 19, 18, 18, 17, 17, 16, 15, 15, 14, 14, 13, 13, 12, 12, 11, 11, 10, 10, 9, 9, 8, 8, 7, 7, 6, 6, 6, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6, 7, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 15, 15, 16, 16, 17, 18, 18, 19, 19, 20, 21, 21, 22, 22, 23, 24, 24, 25, 25, 26, 27, 27, 28, 28, 29, 30, 30, 31, 31, 32, 33, 33, 34, 34, 35, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 42, 43, 43, 44, 44, 44, 45, 45, 46, 46, 46, 46, 47, 47, 47, 48, 48, 48, 48, 48, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 48, 48, 48, 48, 48, 47, 47, 47, 47, 46, 46, 46, 45, 45, 45, 44, 44, 43, 43, 43, 42, 42, 41, 41, 40, 40, 39, 39, 38, 38, 37, 37, 36, 36, 35, 35, 34, 34, 33, 32, 32, 31, 31, 30, 29, 29, 28, 28, 27, 26, 26, 25, 25, 25, 24, 23, 23, 22, 21, 21, 20, 20, 19, 18, 18, 17, 17, 16, 15, 15, 14, 14, 13, 13, 12, 12, 11, 11, 10, 10, 9, 9, 8, 8, 7, 7, 6, 6, 6, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6, 7, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 15, 15, 16, 16, 17, 18, 18, 19, 19, 20, 21, 21, 22, 22, 23, 24, 24, 25, 25, 26, 27, 27, 28, 28, 29, 30, 30, 31, 31, 32, 33, 33, 34, 34, 35, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 42, 43, 43, 44, 44, 44, 45, 45, 46, 46, 46, 46, 47, 47, 47, 48, 48, 48, 48, 48, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 48, 48, 48, 48, 48, 47, 47, 47, 47, 46, 46, 46, 45, 45, 45, 44, 44, 43, 43, 43, 42, 42, 41, 41, 40, 40, 39, 39, 38, 38, 37, 37, 36, 36, 35, 35, 34, 34, 33, 32, 32, 31, 31, 30, 29, 29, 28, 28, 27, 26, 26, 25, 25, 25, 24, 23, 23, 22, 21, 21, 20, 20, 19, 18, 18, 17, 17, 16, 15, 15, 14, 14, 13, 13, 12, 12, 11, 11, 10, 10, 9, 9, 8, 8, 7, 7, 6, 6, 6, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6, 7, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 15, 15, 16, 16, 17, 18, 18, 19, 19, 20, 21, 21, 22, 22, 23, 24, 24, 25, 25, 26, 27, 27, 28, 28, 29, 30, 30, 31, 31, 32, 33, 33, 34, 34, 35, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 42, 43, 43, 44, 44, 44, 45, 45, 46, 46, 46, 46, 47, 47, 47, 48, 48, 48, 48, 48, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 48, 48, 48, 48, 48, 47, 47, 47, 47, 46, 46, 46, 45, 45, 45, 44, 44, 43, 43, 43, 42, 42, 41, 41, 40, 40, 39, 39, 38, 38, 37, 37, 36, 36, 35, 35, 34, 34, 33, 32, 32, 31, 31, 30, 29, 29, 28, 28, 27, 26, 26, 25, 25]; var i=0; addEventListener(Event.ENTER_FRAME,mainloop); function mainloop (event:Event) : void { i++; TweenLite.to(clip, 0, {x:200, y:300-(5*sin[i]),ease:Linear.easeNone, immediateRender :true} ); if (i>256){ i=0; } } is there a "better way" for me to do this (as I want the coords change to be done at 50hz rate)? I used a sin table here but just for testing as I know I could use a sine ease with repeat to achieve the same move of course)
  7. Basically probably very close to each other. 1st: In order to save CPU cycles, I thought it would be easier to precalculate coordinates in an array and go thru the array values with tweens. My question is imagining I have an coordinates array with 512 values. Where do I put the loop going thru them to have it updated as quick as possible? (do I need to put the loop and tween line in en "ENTER FRAME" function? 2nd: I'd like a tween to follow mouse moves. do I just need to set x:mouseX and y:mouseY to have it updated in real time? Thanks in advance.
  8. so basically, if my line is TweenMax.fromTo(red_double_2, 0.5, {y:8, scaleY:0.6,colorMatrixFilter:{brightness:0.4}}, {y:100, onComplete:bar_1_low, ease:Sine.easeIn, scaleY:1, colorMatrixFilter:{brightness:1}}); at 50fps as I want my tween to be 25 frames long, I just change it to: TweenMax.fromTo(red_double_2, 25, {y:8, scaleY:0.6,colorMatrixFilter:{brightness:0.4}}, {y:100, onComplete:bar_1_low, ease:Sine.easeIn, scaleY:1, colorMatrixFilter:{brightness:1},useFrames:true}); ??
  9. Hi Another noob question for me: Is there a way to set the duration timingto frames instead of seconds by default for all the tweens in a project? Cheers
  10. In any cas I'll have to "ungroup" all clips as I can't find a way to change the displaylist order easily for the result I'm after. I'll try another solution with Tweenlinemax but the event "flow" is a bit hard for me to recreate... It might help for me to visualise it on a real timeline before trying to do it in "code" Thanks for the reply in any case, I definitely have to go deeper in the AS doc but for a beginner like me, it's rather overwhelming
  11. Hi all, This might sound like a very dmb question but even looking thru the foru m i could not get an answer i would understand. (I'm a early beginner in AS3 and coding in general) basically I'm trying to sequence two sets of events, triggere by completion of each other. I thought that using the onComplete trigger would do the job but it does nto seem to. my code is like that: function double_front(){ // DOUBLE COPPER DEVANT ET TRIPLE DERRIERE PREMIERE MOITIE TweenMax.allFromTo([red_double_2, red_double_1], 1.5, {y:16,scaleY:0.8,colorMatrixFilter:{brightness:1}}, {y:100, scaleY:1, colorMatrixFilter:{brightness:1.2},repeat:-1,onComplete:double_back, delay:0.4, ease:Sine.easeIn},0.4); } function double_back (){ TweenMax.allFromTo([red_double_1, red_double_2], 1.5, {y:100,scaleY:1,colorMatrixFilter:{brightness:1}}, {y:200,scaleY:0.8, colorMatrixFilter:{brightness:1.2}, repeat:-1,onComplete:double_front, ease:Sine.easeOut},0.4); } double_front() the 1st function runs OK, but the second is never triggered... what am I doing wrong? (absically, I have to do this 1/2 way through a move where a clip has to go in front of the other.. so if there's another solution to do it, I'm also open )
×
×
  • Create New...