Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by swiftmend

  1. Thanks. I got it working. Turns out I wasn't setting up my layout properly, and was simply not correctly using the class. Amazing performance once I figured it out properly - love green sock!
  2. Hi, I'm working on a mobile app that shows a list of players avatars, these avatars are made up of text, external swfs and other things. It's basically a big movie clip holding these objects. Now, I'd like to be able to smoothly tween up/down this list using throw props. I have all the functionality I want done, but the performance is not very good. Am I doing something wrong? This is my code: function mouseDownHandler(event:MouseEvent):void { TweenLite.killTweensOf(container); y1 = y2 = container.y; t1 = t2 = getTimer(); container.startDrag(false, new Rectangle(bounds.x, -99999, 0, 99999999)); container.addEventListener(Event.ENTER_FRAME, enterFrameHandler); container.stage.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler); } function enterFrameHandler(event:Event):void { y2 = y1; t2 = t1; y1 = container.y; t1 = getTimer(); Mask.update(); } function mouseUpHandler(event:MouseEvent):void { container.stopDrag(); container.stage.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler); container.removeEventListener(Event.ENTER_FRAME, enterFrameHandler); var time:Number = (getTimer() - t2) / 500; var yVelocity:Number = (container.y - y2) / time; var yOverlap:Number = Math.max(0,container.height - bounds.height); ThrowPropsPlugin.to(container, {throwProps:{ y:{velocity:yVelocity, max:70, min:70, resistance:200} }, onUpdate:Mask.update, ease:Strong.easeOut }, 10, 0.3, 1); }
  3. I'm trying to get a realistic ease for a ball, this is my current tween: myTween = TweenLite.to(this, 1, {physics2D:{velocity:velo+StepForce, angle:CurrentAngle, ease: Quart.easeOut}}); This is a top down view of a ball that you can kick around, I'd like the balls friction to basically ease to 1, but it doesn't appear you can set friction to happen over a tween, only the initial setup. I don't mind doing an onUpdate to recorrect it, but the tweens other elements would need to all remain the same. Is there a better ease for a rolling stop type ease?
  4. Hi, I'd like to have a movie clip that follows a Bezier path with its rotation oriented toward its path as per normal with the usual orientToBezier: true. However the twist is I need a child of that movie clip to have a movie clip that doesn't rotate along with it, so I need to correct its rotation every frame to make it up right. Any ideas on this one?
  5. No worries - Got everything working! Love greensock!
  6. Is there a simple way to add/remove elements from a CirclePath2D motion path to dynamically increase/decrease the movie clips on the path? I'd basically like only a quarter of the circle visible, which is populated by an array of movie clips - 3-4 would be on-screen at any time, when they go off-screen the next object is placed at the beginning, etc. I've thrown together a basic demo, which is adding the elements to the circle, which goes back/forth as I'd like - but what I need is the ability to support an array of about 30 of these movie clips, with them being added/removed as they hit the borders of that white line. Any tips? I've spent a few hours on it and have not been able to solve it. fla: http://db.tt/2VDygRQ
  7. Is this task simply not doable, or too hard? Is there a work around?
  8. Hi, I have several entry points onto a main bezier looping pathway, when they join it, they will continue to loop around (until they break off, which is other code, but what I need to get working perfectly now is the looping of the main loop). Any ideas on how to solve the "jump" when it loops? I'm talking about the time and rotation issue when it loops. I've read that UpdateTo is what I want to use, but have tried various uses of it and have not found a solution! Check out the fla (codes on the timeline): http://db.tt/VGJ44KL
  9. I found this place with some info: http://stackoverflow.com/questions/1448 ... ess-bezier suggestion is using UpdateTo(), but I can't get that to do much. Any clues? Cheers
  10. I've made a very simple demo showing my current issue. I have several entry points onto the main bezier looping pathway, when they join it, they will continue to loop around (until they break off, which is other code, but what I need to get working perfectly now is the looping of the main loop). Any ideas on how to solve the "jump" when it loops? Check out the fla (codes on the timeline): http://db.tt/pQIOpfn
  11. Excellent, that works. Only issue remaining is getting the loops rotation to line up perfectly. But I suspect thats due to my positioning - I don't think there is anyway to seamlessly tween from one bezier to another?
  12. sorry, i don't know what this means. can you provide an image or better description? I; currently using orientToBezier:true - to have my movie clips face the direction of the tween they are moving in. However when you reverse a bezier tween, it doesn't reverse the direction they face in, they continue to face the correct direction, rather then the new reverse direction. That make sense, or should I get a pic together?
  13. Thanks! I wasn't actually using a round circle, more rather a path that ended where it began, so I opted for adding the onComplete and onCompleteReversed stuff to mine and it works well for the issue of looping. Only issue is the remaining is getting the bezier itself to face in the reversed direction, is there any other functionality I'm missing that would do this?
  14. Hi, I'm trying to figure out a way of reversing a bezier tween, and have it loop. So I basically have a series of points that form a circle, I need to be able to on the fly, make the Tween reverse to go in the reversed direction, but I want it to continue looping in a circle. I am using repeat: -1 to make it loop, which works fin going forwards, but it doesn't utilise it when a reverse() is called, it just stops when it gets to zero, how can I get around this and make it loop back to the final pint when it hits the first point? Also, is there a way to change the facing of the tween, I have the Bezier to to orientToBezier: true - but it doesn't seem to care about that when reversing, which I guess is functionality (as it's literally a tween reverse, rather then a path reverse).
  15. Excellent! Fixed. Thanks 100%!
  16. Hi, I'm unable to get colorTransform working properly: This is what I've got: var ColourPallet:Array = [1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1] TweenPlugin.activate([ColorTransformPlugin]); TweenPlugin.activate([ColorMatrixFilterPlugin]); TweenMax.to(ColoursBlock, 0.5, {colorTransform:{redMultiplier:ColourPallet[0], redOffset:ColourPallet[1], greenMultiplier:ColourPallet[2], greenOffset:ColourPallet[3], blueMultiplier:ColourPallet[4], blueOffset: ColourPallet[5], exposure:ColourPallet[10]}}); TweenMax.to(ColoursBlock, 0.5, {colorMatrixFilter:{contrast:ColourPallet[6], brightness:ColourPallet[7], saturation:ColourPallet[8], hue:ColourPallet[9]}}) Now for whatever reason, the colorMatrixFilter all works fine, as does "exposure" in the colorTransform. However none of the Multipliers work or the offsets, the colours don't change at all. Any clue why this would be?
  17. Hi, I'm building a mobile app and have noticed there is considerable lag the first time I tween an object, but its super smooth afterwards (after its cached obviously). Is there a way to precache a tween?
  18. Alright, after some testing, no glow filters work at all when using GPU render. Obviously an issue on Adobes on not greensocks! What a pain! Ah well.
  19. As stated in title, I've been using the glowFilter for a selection type confirmation tool. However it seems that when setting Render type to GPU for iOS it doesn't work at all. It works fine when set to Auto/CPU, however GPU just does nothing. Which is sad, as GPU gives more then twice a performance increase for me due to bitmaps. Any reason for this, is it fixable - or should I create an alternative for my selection type? Tested on both an iPad with 4.2 and an iPhone 4 via AIR for iOS both with GPU render set. I've tried both previously with AUTO set and the glow worked fine. EDIT: Also went ahead and tested it on my Nexus One via AIR for Android running FroYo 2.2 - same issue, no glow when set to GPU. I'm assuming at this point this might be a limitation for for targeting GPU on AIR (odd that AUTO and CPU work though..)
  20. That's awesome! Works brilliantly now. I've aded that code to my template I use so all future apps with have it in place and i'll replace existing code as I go through and edit those older flas. Thanks for the help!
  21. Alright sure, they're work files though, so i'll send them via PM. I'll make a basic loader swf (no point using my main swf) and send through two demo .flas with it.
  22. It's strange, anytime I try to use greensock I get a ton of null errors across my SWFs however the standard Loader works fine. I'm loading an object on the timeline that gets referenced straight away and that seems to give errors, I updated to the latest and no help. They're pretty complex SWFs at this point though, so I guess I'll stick with Loader and use SWFLoader in future products.
  23. Hi, It seems LoaderMax SWFLoader opens and uses the class file before accessing any actionscript on the loaded swfs timeline - is there a way to force it to load the actionscript on the timeline first? I have an unusual need of this, the default Loader does this so I'm unable to use SWFLoader until I can figure out how to get it to duplicate this behaviour - which I'd much rather do as it allows much cleaner usage.
  24. EDIT: Looks like it is, DynamicIconQueue:LoaderMax.empty(true, true) To clear queue & unload old data. ----------------------------------- How would I "empty" a queue so that I can append new loaders to it, without it loading the old stuff again? EG: var DynamicIconQueue:LoaderMax=new LoaderMax({name: "dynamicQueue"}); var RecentDynamicallyShow:Array = [] function LoadDynamicImages():void { RecentDynamicallyShow:Array = [] //array is cleared /////////// //work out images to load here (different each time and push into RecentDynamicallyShow array /////////// // images are loaded based on array just created DynamicIconQueue.append(new ImageLoader("Assets/Icons/" + RecentDynamicallyShow[0] + ".png")); DynamicIconQueue.append(new ImageLoader("Assets/Icons/" + RecentDynamicallyShow[1] + ".png")); DynamicIconQueue.append(new ImageLoader("Assets/Icons/" + RecentDynamicallyShow[2] + ".png")); DynamicIconQueue.append(new ImageLoader("Assets/Icons/" + RecentDynamicallyShow[3] + ".png")); DynamicIconQueue.load() } How would I empty DynamicIconQueue at the beginning of that function? Currently it's just appending those to the old queue and loads the old underneath the new.