Jump to content
Search Community

GreenSock last won the day on May 19

GreenSock had the most liked content!

GreenSock

Administrators
  • Posts

    23,185
  • Joined

  • Last visited

  • Days Won

    822

Everything posted by GreenSock

  1. A LiquidWrapper is just a DisplayObjectContainer, so you can put it anywhere you want in the display list. By default, yes, it adds itself to the top of the list, although you bring up a good point - it would be more intuitive to use the child's index by default. I updated the class in the link I sent you. Please download it and give it a shot. Regardless, though, you can just move the LiquidWrapper around in the display list just like any other DisplayObject. For example, you could use setChildIndex(). As far as the Scale9 stuff, I'm not aware of any bugs with that - LiquidStage just does simple width/height property alterations which shouldn't cause any problems, but send me a broken FLA if you've got one (please zip it first and don't include LiquidStage).
  2. Did you receive the files I sent you that demonstrated it working?
  3. It looks like you didn't init() LiquidStage in your example. As far as using LiquidBox with LiquidStage, LiquidBox has actually been renamed LiquidWrapper which works pretty much the same - it's just a DisplayObjectContainer that automatically scales its children proportionally to compensate for any scaling/stretching that happens to it. So you addChild() your DisplayObject(s) into the LiquidWrapper and then pin the LiquidWrapper with LiquidStage. You can tell your contents to align center, left, top, bottom, or right. It's pretty simple to get up and running: var wrapper:LiquidWrapper = new LiquidWrapper(myObject); LiquidStage.init(this.stage, 550, 400); LiquidStage.stretchObject(wrapper, LiquidStage.TOP_LEFT, LiquidStage.TOP_RIGHT, LiquidStage.BOTTOM_LEFT); Also, you can add an event listener to LiquidStage to listen for when it resizes things and then you can run any code you want (like adjusting the scale of an object so that it's proportional). Just do: LiquidStage.addEventListener(Event.RESIZE, myFunction); Hope that helps.
  4. Could you post (or e-mail me) an FLA that demonstrates this issue? I just tried recreating it on my end and didn't see any problems at all. Maybe I'm missing something though.
  5. Sorry, I'm not sure how Flash Media Server handles things. Sounds like a problem in FMS.
  6. Since flipping requires a negative scaleX and/or scaleY value, you'd need to set the minimum to be negative (your example used positive minimums). (we communicated via e-mail and resolved the issue)
  7. You must pass real references to the object, not just their String names. In other words: BAD: targetObjects:["links0","links1","links2","links4"] GOOD: targetObjects:[links0,links1,links2,links4] //(assuming links0, links1, etc. reference valid MovieClips) XML stuff is always just String data, so you're telling TransformManager that you want to literally transform text/Strings instead of the actual MovieClips themselves.
  8. TweenLite/Max can work with any 3D engine/plugin. They'll tween any property of any object, so developers use them with Papervision 3D, Away3D, the built in Flash 3D stuff in Flash Player 10, whatever. Feel free to use whichever you like. As far as Simple3D, I didn't release it. I got pulled into other stuff and couldn't overcome one challenge related to rotating multiple Quaternions simultaneously. I may eventually get around to it again, but right now my focus is on v11 of the tweening platform.
  9. I just updated TransformManager so that if you've got an object that "hasSelectableText" selected, pressing the arrow keys won't move it even if "arrowKeysMove" is true. Thanks for the suggestion!
  10. Here's something I whipped together. You could certainly modularize it more, put it into classes, etc., but hopefully it gives you the general idea. You could just copy/paste this into a blank FLA and publish it to see (make sure you've got the latest v11 "gs" directory with the FLA though): import flash.display.*; import flash.geom.*; import gs.*; import gs.easing.*; var line:Shape = new Shape(); this.addChild(line); var myPath:TimelineLite = buildPathTimeline([new Point(40, 200), new Point(120, 130), new Point(150, 220), new Point(260, 70), new Point(290, 120)], line.graphics); TweenLite.to(myPath, 5, {progress:1}); //simply tween the progress property from 0 to 1 to draw the line. function buildPathTimeline($points:Array, $graphics:Graphics):TimelineLite { var timeline:TimelineLite = new TimelineLite({paused:true}); var p:Point //point var pPrev:Point = $points[0]; var prevPoints:Array = []; //keep track of the points that come before each point in the sequence var dx:Number; //distance on the x-axis var dy:Number; //distance on the y-axis var d:Number; //distance var pen:Object; //stores information about the coordinates and previous points for each one in the Array for (var i:int = 1; i p = $points[i]; pPrev = $points[i - 1]; prevPoints.push(pPrev); pen = {x:pPrev.x, y:pPrev.y, prevPoints:prevPoints.slice()}; dx = p.x - pPrev.x; dy = p.y - pPrev.y; d = Math.sqrt(dx * dx + dy * dy); timeline.append(new TweenLite(pen, d, {x:p.x, y:p.y, ease:Linear.easeNone, onUpdate:updateLine, onUpdateParams:[$graphics, pen]})); } return timeline; } function updateLine($graphics:Graphics, $pen:Object):void { $graphics.clear(); $graphics.lineStyle(10, 0xFFD700, 1, false, LineScaleMode.VERTICAL, CapsStyle.ROUND, JointStyle.ROUND, 10); var points:Array = $pen.prevPoints; $graphics.moveTo(points[0].x, points[0].y); var l:uint = points.length; for (var i:int = 1; i $graphics.lineTo(points[i].x, points[i].y); } $graphics.lineTo($pen.x, $pen.y); }
  11. Handle-related code is mostly in initSelection(), createHandle(), and redrawHandles(). As for the reason why the selection box/handles need to have the same parent, it has to do with them tracing the _dummyBox exactly which I suppose could be accomplished using localToGlobal() and globalToLocal() on each point, but I was trying to avoid that for performance reasons. Technically I believe it would be possible to have the selection box/handles appear elsewhere. Glad you're likin' the code
  12. Sure, v11 opens up lots of other possibilities, and it's just as easy to accomplish this task with TimelineLite as it was with TweenGroup: import flash.display.*; import gs.*; 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); var sequence:TimelineLite = new TimelineLite({tweens:[ [drawer, 0.1, {x:200, ease:Quad.easeOut, onUpdate:drawLine}], [drawer, 0.1, {y:100, ease:Quad.easeOut, onUpdate:drawLine}], [drawer, 0.1, {x:0, ease:Quad.easeOut, onUpdate:drawLine}], [drawer, 0.1, {y:0, ease:Quad.easeOut, onUpdate:drawLine}]], align:TimelineLite.ALIGN_SEQUENCE}); function drawLine():void { line.graphics.lineTo(drawer.x, drawer.y); }
  13. The talented team at EVB Saatchi & Saatchi (LA) just won FWA site of the day for this site which made use of TweenMax quite a bit: http://www.toyota.com/vehicles/minisite/newprius/ Congrats, guys!
  14. I totally see your logic there, but the problem is that it would prevent use cases that should be perfectly legitimate. You're assuming that the only use for TransformManager is for user interaction based transformations, but there are customers who want to control everything through code and do some customized stuff that doesn't require the targetObjects to be InteractiveObjects. See what I mean? The down side is that occasionally folks will make the mistake you did (and sorry, it didn't even dawn on me to ask you about that), but the up side is that it's not locking developers into only being able to manage InteractiveObjects. I'll put a note in the documentation, though. Thanks for pointing it out.
  15. The problem is that you wrapped your TextField in a MovieClip. So it's like it's being seen through a "lens" and that lens is getting distorted. That's just how Flash works. The only way around that (that I know of) is to override the width/height or scaleX/scaleY setter of the MovieClip wrapper and have it resize your TextField's width/height instead. So you'd have to create a custom class for that.
  16. You can use an included LiquidWrapper class that's basically a Sprite that you can dump stuff into and then you pin the LiquidWrapper and it make sure its contents are scaled proportionally. Sorry I didn't answer sooner - the forum didn't notify me via e-mail about this one. Hope to see you on the membership roster soon. If you hate LiquidStage and the rest of the bonus stuff, keep in mind that there's a 30-day money-back guarantee.
  17. Sorry, but the selection box/handles have the same requirement as everything else - it must share the same parent as the rest of the targetObjects. The reason has to do with accommodating multiple selections.
  18. Adding items to the ignoredObjects list is really about preventing them from causing DESELECTION, so it doesn't actually alter the stacking order or the way MouseEvents are triggered (or not triggered) in Flash. So if you have an object over the top of the item you want to select, Flash will still prevent mouse interaction with the item below. You'd need to set mouseEnabled to false on the interfering items (that's unrelated to TransformManager). Make sense?
  19. It looks like you probably have something in front of the target object that is preventing a ROLL_OVER event from getting triggered. Might that be the case?
  20. By popular request, here's a "sticky" thread for showcasing what you've done with the GreenSock tweening platform. Go ahead and brag a little. It's allowed. Inspire others with what you've created. Even if it's not super whiz-bang, maybe you've got an effect or technique you used that could help others or give them some ideas. Please don't use it as a soliciting tool for jobs, though. Post your stuff and keep it short and simple. If you want to discuss the details about a particular technique, that's great - just start another thread and link to it from this one. Don't be shy. There's a huge community of users out there who could be inspired by your efforts.
  21. I bet your item is running into the bounds. Remember, FlexTransformManager won't allow items to go past its edges. So let's say your FlexTransformManager is 300 pixels wide and tall and you load an image in that's 200 pixels wide and then try to moveSelection(200, 200), it'll actually end up only moving it 100 pixels in each direction. Then if you try moving it backwards (-200, -200), it will again only go 100 pixels either way assuming it started at 0, 0. It protects rotations from going outside the bounds too, just so you know. As for the numbers being slightly off, it is likely just due to floating point rounding issues which are next to impossible to avoid. I tried your code and it worked exactly as expected. As long as I wasn't violating the bounds, it went right back to where it was supposed to be. Also remember that rotations occur using the center of the object as the axis, so if the object's registration point is in the upper left (or anywhere other than the center), the x/y properties will be affected by rotations.
  22. Any chance you could post a sample FLA? (don't include Simple3D please). The simpler the better And/or could you circle where the distortion/artifacting is happening? I haven't run into anything like that before.
  23. Aha! Sorry about that - I needed to tweak one line of the code so that it would retain the delay you set in the vars object. My bad. It's fixed now. Please download the latest version and give it a shot. http://blog.greensock.com/v11beta/
  24. Oh, if you don't need to call a function when it's all done, you can just omit those last two parameters. The stagger is the 4th parameter. Your allFrom call would look more like: TweenMax.allFrom([hexOrangeA,hexGreenA,hexOrangeB,hexOrangeC,hexGreenB,hexOrangeD,hexGreenC,hexOrangeE,hexOrangeF,hexOrangeG,hexOrangeH,hexOrangeI], 1, {autoAlpha:0, delay:1, scaleX:0, scaleY:0, ease:Back.easeOut}, 0.2)
  25. Yep, that's because in order to clarify the API better, I moved "stagger" to official parameter status OLD: TweenMax.allTo([mc1, mc2, mc3], 1, {x:100, stagger:0.2, onCompleteAll:myFunction, onCompleteAllParams:[2, "myString"]}); NEW: TweenMax.allTo([mc1, mc2, mc3], 1, {x:100}, 0.2, myFunction, [2, "myString"]); This has the added benefit of strict data typing, more helpful code hinting in certain authoring tools, and reduced code. Sorry about any confusion.
×
×
  • Create New...