Jump to content


  • Posts

  • Joined

  • Last visited

Rabies's Achievements



  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!