Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by Rabies

  1. I just found out today that there was this "startAt" parameter that finally solves my problem with constantly setting starting values for properties. Unfortunately, it doesn't seem to work as expected when there are delays. Maybe I'm going about this the wrong way. Example: TweenMax.to(mc, 0.6, { scaleX:1, scaleY:1, delay:0.7, startAt:{scaleX:0,scaleY:0}, ease:Elastic.easeOut }); There is a 0.7 delay there. I would expect the startAt parameters to be used right away, not after the delay. Does this make sense? Is there an alternate way to do this? Otherwise I'm stuck setting the start property values like I always do. ie: mc.scaleX = mc.scaleY = 0; TweenMax.to(mc, 0.6, { scaleX:1, scaleY:1, delay:0.7, ease:Elastic.easeOut }); thanks, rb
  2. Hello. I am checking out v12 AS3 Tweenlite for the first time. Previously I used 10 and 11 extensively. I see now there is a "greensock.swc" file. What do I do with this? I can't find reference to it in the "docs" nor when I search this forum.
  3. Thanks, am doing that then.
  4. I was wondering if a version newer than v11 (as3) is best suited for iOS / iPhone ?
  5. No, as you can see in my code example, that's what I'm already doing. I check a flag and then either execute Tweens with motion blur or without. It's just that I have this if check in dozens of places. No big deal but was hoping there was a secret to cleaner way to doing it.
  6. Is there a way to turn a plugin like motion blur on/off at runtime without resorting to this kind of bloat? if (OptimizationLevel < 1) { TweenMax.to(FSPanel1_mc, 0.9, { x:203, delay:0.5, motionBlur: { strength:0.4, quality:1 }, ease:Bounce.easeOut }); TweenMax.to(FSPanel2_mc, 0.9, { x:400, delay:0.5, motionBlur: { strength:0.4, quality:1 }, ease:Bounce.easeOut, onComplete:showFreeSpinClips }); } else { TweenMax.to(FSPanel1_mc, 0.9, { x:203, delay:0.5, ease:Bounce.easeOut }); TweenMax.to(FSPanel2_mc, 0.9, { x:400, delay:0.5, ease:Bounce.easeOut, onComplete:showFreeSpinClips }); } Would be easiest if I could turn it off in TweenMax, but still have " motionBlur: { strength:0.4, quality:1 }," in the script, but just have it ignored. I have to be able to dynamically turn this on and off.
  7. ** If I move the TweenMax line so that it executes after everything else has completed, then it all works.
  8. Here is my code: TweenLite.to(dragonfly_mc, 1.2, { x:800+dragonfly_mc.width, visible:1, ease:Linear.easeNone }); // ...then fade in the background... background_mc.alpha = 0; TweenLite.to(background_mc, 1.6, { alpha:1, visible:1, ease:Expo.easeIn }); // logo logo_mc.alpha = 0; TweenLite.to(logo_mc, 0.5, { alpha:1, visible:1, delay:1.6, ease:Linear.easeNone }); // bring in the symbols in animated sequence var i:Number; var L:Number = 3 * 5; for(i=0; i var Clip = this["sym" + i]; Clip.scaleX = Clip.scaleY = 0; TweenLite.to(Clip, 0.6, { scaleX:1, scaleY:1, visible:1, delay:1.6 + (i * 0.1), ease:Expo.easeOut }); } // slide in the win leaf totalwin_mc.visible = true; TweenLite.from(totalwin_mc, 0.8, { x:800, delay:2+(i*0.1), ease:Elastic.easeOut, onComplete:showInstructions }); The above fades and tweens everything in beautifully. But when I add the following line after the last one, all the fade-ins don't work anymore. Even the scaled in tweens don't work. Everything just pops in. TweenMax.to(logo_mc, 2, { y:"-20", yoyo:1, repeat:-1, delay:10, ease:Sine.easeInOut, overwrite:0 }); // "float" the logo I tried changing everything to TweenMax with the exact same results. What is going on?
  9. Yes, lowering frame rate reduces the CPU usage. For example, a FPS of around 20 will knock down the CPU consumption to the 20-30% range. I'll post some sample files when I get to the optimization stage. (Adobe *is* aware of the issue, as you see the URL I posted in the first post is on their site. )
  10. I just took the entire enter_frame function out and re-published. THe app still uses up to 60% cpu resources. Adobe AIR is just a resource hog.
  11. I understand, no problem. Regarding CPU usage, I do have a z-sorting function running on enterframe. It's the only thing I imagine is keeping the CPU use up, however Adobe AIR apps *are* notorious CPU resource hogs. It's just how it is. I'm also using MovieClips (I'm new to AS3, so I'm doing things in a way I was used to in AS2, until I learn more). I could perhaps make sure the z-sorting only runs when my 3D cube is rotating. This is the sort code, in case you were curious: mcCube.addEventListener(Event.ENTER_FRAME, cubeRender); function cubeRender(event:Event):void { // z-sorting credit goes to http://theflashblog.com/?p=470 // accelerate the rotation stepX = 0;// no default motion //stepX = (mouseY-stage.stageHeight/2)/(stage.stageHeight/2)*-thrust; if (stepRemX < stepX) { stepRemX += accelerate; } else if (stepRemX > stepX) { stepRemX -= accelerate; } stepY=0; // temp stopper //stepY = (mouseX-stage.stageWidth/2)/(stage.stageWidth/2)*thrust; if (stepRemY < stepY) { stepRemY += accelerate; } else if (stepRemY > stepY) { stepRemY -= accelerate; } // simply rotate the whole mcCube holder mcCube.rotationX += stepRemX; mcCube.rotationY += stepRemY; for (c = 0; c < 6; c++) { // get a reference to all 6 mcCube sides mcCubeSide=MovieClip(mcCube.getChildAt(c)); //This transformed matrix contains the actual transformed Z position. transformedMatrix = mcCubeSide.transform.getRelativeMatrix3D(this); //store this mcCubeSideMC and its 'z' position in the sortArray. sortArray[c].MCobject=mcCubeSide; sortArray[c].screenZ = transformedMatrix.position.z; } // sorting sortArray.sortOn("screenZ", Array.NUMERIC | Array.DESCENDING); for (c = 0; c < 6; c++) { // set the 3 sides in the back to visible = false and render the 3 in the front according to their Z Sorted value. if (c<3) { //sortArray[c].MCobject.visible=false; } else { mcCube.setChildIndex(sortArray[c].MCobject, c); sortArray[c].MCobject.visible=true; } } }
  12. Mr Sock, Have you considered implementing support for frame throttling? I'm working on an Adobe AIR project and the CPU resources it uses is horrible (50 to 60% of the CPU for an app that's running at 40 fps!) Adobe suggest frame throttling when the app is not active. Since frame rate is mostly for motion, what you do is set the frame rate low when the "movie" is not doing much, and then put it back up when you need smooth motion: http://www.adobe.com/devnet/air/flex/ar ... tling.html Since animation in my projects rely almost entirely on your Tween package, it should be fairly easily to implement a frame throttling solution directly into the tween package, however I don't know enough about modifying classes, etc to do so. The way I envision this feature working in your package would be: 1. Make it a plugin that you activate. 2. In the flash movie, I would set the frame rate low, let's say 4fps. 2. You add a property to set the frame rate. So for example when I tween it would look like this: TweenLite.to(mc, 0.3, {scaleX:1, scaleY:1, framerate:40, ease:Expo.easeOut}); What would then happen is A. your script would first fetch and store the current framerate via stage.frameRate B. set the framerate to 40 at the start of the tween. C. On completion of the tween you set it back to the stored value. Complications: You'd have to also track if multiple tweens are going, so they don't over-write each other. I suppose ideally instead of a property/parameter in the actual Tweening script line, perhaps a global variable of some sort could be set so the Tween package knows what to consistently use when tweening, and this way there's no chance of different framerate values competing. I also realize such a feature would not be compatible with AS2 or old versions of Flash (prior to 9 I think?) I haven't outlined the ideal solution here, but it's something to think about that I am sure you could perfect. Let me know if you add this! In the mean time I have to implement my own solution. RB
  13. (Replying here just so I can get notified of the answer you get.) PS: Mr. Sock, I only now discovered relative positions via values in quotes while searching for something else. Is there a list of "hidden gems" like this posted somewhere?
  14. Well, the workaround was rather simple (and I feel bad about it given your lengthy post to help me). I added an onComplete to to the first tween to trigger the second tween in a seperate function instead of relying on delay. So in that second function I put a mcTRIVIA_Q.visible = true; Works!
  15. Wow, what an awesome reply! Thank you so much for the troubleshooting steps. PS: *One note: (i) does nothing to the trivia clips, which is part of what baffles me here, but you got me thinking about their states when returning to that "side" of the cube. PPS: You are right that it's difficult to strip this down. I am new to AS3, and something as simple as just turning off a layer (setting it to Guide) like I used to do in AS2 just breaks everything because of references to missing clips. I really hate that.
  16. Strange "bug" going on... Look here: http://sporeproductions.com/temp/IIDEX-widget.html On the "Home" side of the cube, click on "Select Answer" button, then on the answer panel, click on blue close button. See how the 2 panel movieclips flip and their visible setting turns on/off and the appropriate time to make it look like 1 panel flipping in 3D space? You can even rotate the cube left/right, then come back to that panel and they still flip correctly. But, click the (i) button (upper right corner), then click blue X button to go back. Now try flipping that panel and you'll see that the "visible" property is now being set at the end of the tween instead of the beginning like it originally does. I have one button doing the first flip: TweenLite.to(mcTRIVIA_Q, 0.4, {rotationX:-90, visible:0, ease:Expo.easeIn}); TweenLite.to(mcTRIVIA_A, 0.4, {rotationX:0, visible:1, delay:0.4, ease:Expo.easeOut}); And this script is to flip the panels back again: TweenLite.to(mcTRIVIA_A, 0.4, {rotationX:90, visible:0, ease:Expo.easeIn}); TweenLite.to(mcTRIVIA_Q, 0.4, {rotationX:0, visible:1, delay:0.4, ease:Expo.easeOut}); What would cause TweenLite to change how it tweens visible ??
  17. Never mind, now they seem to work. Odd.
  18. I had a banner that was using TweenLite and I wanted to try to cut some filesize, so I replaced all TweenLite with TweenNano (no plugins in use, nothing special). The method killTweensOf() no longer works. Your comparison chart shows that this method is available in all 3 packages. What's going on?
  19. I don't normally throw in overwrite, that was there just out of frustration that the vars weren't tweening. And I guess I misunderstood its use by setting it to true rather than false. That solves it though! Overwrite should be true!
  20. I'm trying to tween multiple variables that are all in "root" but the only one that actually works is always the last one, even with "overwrite" enabled: TweenLite.to(this, 3,{Wind:100, delay:flakeSpeed+4, onUpdate:updateText, ease:Linear.easeNone, overwrite:1}); TweenLite.to(this, 4,{flakeSpread:300, delay:flakeSpeed+4, onUpdate:updateText, ease:Linear.easeNone, overwrite:1}); TweenLite.to(this, 5,{flakeInterval:0.2, delay:flakeSpeed+4, onUpdate:updateText, ease:Linear.easeNone, overwrite:1}); TweenLite.to(this, 5,{flakeCount:1, delay:flakeSpeed+4, onUpdate:updateText, ease:Linear.easeNone, overwrite:1}); In the above example, only "flakeCount" Tweens. The ones above it are ignored. If I comment out the last line, then "flakeInterval" tweens, and so forth. *** I partially answered my own question (epiphany while typing here): TweenLite.to(this, 5,{Wind:100, flakeSpread:300, flakeInterval:0.2, flakeCount:1, flakeSpeed:5, flakeSpeedVariance:3, delay:flakeSpeed+4, onUpdate:updateText, ease:Linear.easeNone, overwrite:1}); *BUT* using that method, all variables are tied to the same duration, delay, etc. How do I tween multiple variables that require different parameters??
  21. I've used the following line and it works, it makes the clip go from black to normal. TweenLite.from(mc,1,{tint:0x000000, ease:Linear.easeNone}); However, if I first made the clip fade to black, using this: TweenLite.to(mc,1,{tint:0x000000, ease:Linear.easeNone}); Later, when I try to use the "from" version, like above, nothing happens. Now, I know "removeTint" would then work, but it makes for some complications, whereas otherwise I could just use "from" to fade from black, and "to" to fade to black. Do you have any further insight ? Maybe I'm overlooking a technique that would make it that easy.
  22. Ah. I often overlook that there are 2 sets of code to copy in 2 different spots. Thanks!
  23. I am having a problem with RemoveTint. This code here works... doing what I expect, but note how I had to use "TweenMax" in that last function. If I put TweenLite there, it won't remove the tint. Is this a bug? import com.greensock.*; import com.greensock.easing.*; import com.greensock.plugins.*; TweenPlugin.activate([TintPlugin]); function setUp(){ ELEVATOR._visible = false; ELEVATOR._alpha = 0; TweenLite.to(ELEVATOR, 0.1, {_visible:1, tint:0x000000, onComplete:startElevator}); } function startElevator(){ TweenLite.to(ELEVATOR, 2, {_alpha:100, _visible:1, tint:0xff0000, onComplete:animateElevator}); } function animateElevator(){ TweenMax.to(ELEVATOR, 1, {removeTint:true}); } setUp(); stop();
  24. Thank you for the suggested code. I'll try that out. I am however also suggesting that TweenLite 12 have this as a variable/flag. TweenLite.to(mc,10,{_x:600, rate:0.5}); rate would mean "frame rate". 1 = 100% 0.5 = 50% etc I predict some problems supporting this in AS2 however, as the frame rate is not an available property, but is in AS3. (Could approximate current frame rate via polling, but I don't know how accurate that would be). The other alternative would be defining the # of steps to be used in the tween. This method would achieve the same visual effect but obviously would not always look quite the same on different PCs running the Flash at different frame rates. Might be acceptable though.