Jump to content
Search Community

GreenSock last won the day on April 21

GreenSock had the most liked content!

GreenSock

Administrators
  • Posts

    23,151
  • Joined

  • Last visited

  • Days Won

    817

Everything posted by GreenSock

  1. Sure, that should work. Or you could use a TweenGroup which could come in handy if you want to skip ahead or reverse or something... import fl.motion.easing.*; import flash.display.*; import gs.*; 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:TweenGroup = new TweenGroup([{target:drawer, time:0.1, x:200, ease:Quadratic.easeOut, onUpdate:drawLine}, {target:drawer, time:0.1, y:100, ease:Quadratic.easeOut, onUpdate:drawLine}, {target:drawer, time:0.1, x:0, ease:Quadratic.easeOut, onUpdate:drawLine}, {target:drawer, time:0.1, y:0, ease:Quadratic.easeOut, onUpdate:drawLine}], TweenLite, TweenGroup.ALIGN_SEQUENCE); function drawLine():void { line.graphics.lineTo(int(drawer.x), int(drawer.y)); } If you want your easing to apply to the whole group instead of each individual line, you could even set them up in a group each with an ease of Linear.easeNone and then tween the "progress" property of the group and use an ease in that tween. Lots of possibilities.
  2. Oh, I think I see the problem. Two things to keep in mind: 1) When you transform TextFields, TransformManager will change the size of the BOX, not the text. This is actually a feature. If you want the text to transform with the box/handles, just wrap your TextField in a Sprite/MovieClip. 2) You set your TextField to autoSize which explains why it won't allow TransformManager to go smaller than the text - Flash just resizes the TextField immediately to fit the contents. Does that help?
  3. So your TextField is being altered independently AFTER it was added to TransformManager? For example, maybe the size is 100, 100 when it gets added, but then later the user (or you through code) alter the size without going through TransformManager? You should either make all your transformations through TransoformManager OR just make sure you call update() on the TransformItem instance associated with your TextField between the time it was altered and the time it gets selected because TransformManager doesn't "watch" the object to see if you make any changes independently of TransformManager. If that doesn't help, could you post a super-simple FLA that demonstrates the problem? Please strip out all unnecessary code. I'm sure we can get it figured out
  4. It might just be a scope issue. Try this: import mx.utils.Delegate; Delete_btn.onPress = Delegate.create(this, onPressDelete); function onPressDelete():Void { manager_obj.selectedItem.deleteItem(); }
  5. Ah, are you using the AS2 version? Sorry - I thought you were using AS3. There's no deleteSelection() method in the AS2 version. You could, however, do something like: Delete_btn.onPress = function() { myManager.selectedItem.deleteItem(); }
  6. Sure, there's an undocumented deleteSelection() method you can call Does that help?
  7. I didn't see where/how you're handling reparenting (if at all). You problem may be related to that. Please keep in mind that there is a BUG in the Flex Framework (not TransformManager) that won't let you scale TextFields disproportionately (I mention this on the TransformManager page and documentation). You're using Flex, right? (you mentioned "Canvas", so I assume you're working in Flex).
  8. Oh, I believe you're talking about turning "smoothing" on for that image/graphic. There are a few ways to do it. If it's in your FLA's library, just right-click on the image (I'd recommend using PNGs), choose properties, and check the checkbox that says "smoothing" or "enable smoothing". If you're loading it dynamically, you have two choices: 1) Try wrapping it in a Bitmap() object and set the smoothing property to true. 2) Create a BitmapData and make sure its smoothing property is set to true via the constructor (see the Flash help docs for more info). Then draw() your image to that BitmapData and attach it to a Bitmap and work with it that way. Basically, make sure smoothing is true for your object and it'll scale much better.
  9. TransformManager defines its parent the first time you add an item to it. If you're going to reparent the item(s), I'd recommend just creating a new TransformManager instance for that new parent. Just destroy() the first TransformManager and create a new one and add your item(s) to it for the new parent. Does that answer your question?
  10. Could you describe what you mean by resampling vs. resizing with TransformManager?
  11. I have never personally saved something out as a JPEG, but I seem to remember seeing some articles about doing that online, so I think it is possible. Obviously TransformManager won't do that for you - you'd need to handle saving the stuff out as a JPEG on your own, but again, I'm pretty sure it's possible. I'm also 99% sure that you must involve a server-side script, and it tends to be pretty bandwidth-intensive, so you may not be happy with the performance. Good luck!
  12. It that situation, I'd recommend setting autoDeselect to false, and then put a Sprite below your objects (it could have an alpha of zero so it's essentially invisible) and use a CLICK or MOUSE_DOWN listener on that Sprite to call a function that calls deselectAll() on your TransformManager. That way, the only time things get deselected is when you click on the "background" (that Sprite). Make sense?
  13. Right. It looks like you're violating the _parent rule. Every time fAddEmoticon() gets called, you're creating a MovieClip within another MovieClip and adding that nested MovieClip to TransformManager, so every one of them will have a different parent. See what I mean? Maybe try adding __reg3 instead of __reg2.
  14. I'd need to see the rest of your code to know what the problem is for sure. Keep in mind that I believe the TransformItems must share the same _parent which is where the selection handles will be drawn, etc. So if you're nesting your MovieClips in ways that don't conform to that, you'll likely run into trouble.
  15. Yes, that's expected behavior - TransformManager dispatches SELECTION_CHANGE events whereas TransformItems dispatch SELECT events. If you want to listen for when theSprite gets selected, you can set up a listener on the corresponding TransformItem, like this: var myItem:TransformItem = manager.getItem(theSprite); myItem.addEventListener(TransformEvent.SELECT, onSelectClip1); Make sense?
  16. What exactly were you looking to accomplish? You should be able to use TweenMax with virtually any class.
  17. Yeah, sorry, but you'll need to do the math when you load the new image to figure out what the scale needs to be in order to fit the width/height you need. Something like newScaleX = oldWidth / newWidth and newScaleY = oldHeight / newHeight
  18. Great catch! Sorry about that. I just fixed it and released an update. You should have already received an e-mail about it by now. Jack
  19. Sorry, I'm absolutely SWAMPED with work right now. Stayed up 'til about 4am the last 5 nights working. I may have to stay up all night tonight too, so I just can't afford the time to write the code for you. But I can assure you, it's very possible to dynamically load images and use them with TransformManager. If anyone else wants to chime in and help out, great.
  20. I assume you're using the AS2 version, right? Here's an excerpt from the FAQ section of the blog: Does that help?
  21. Sip the coffee....let the caffeine kick in.... Feeling better? Okay, good question. addItem() returns a TransformItem, so you can just use that to add the min/max scale, like so: var myItem:TransformItem = myManager.addItem(myDisplayObject); myItem.setScaleConstraints(0.5, 1, 0.5, 1); //or set them directly if you don't want to use the setScaleConstraints(); myItem.minScaleX = 0.5; myItem.maxScaleX = 1; myItem.minScaleY = 0.5; myItem.maxScaleY = 1; You can also get the TransformItem associated with your DisplayObject anytime using the getItem() method, like: var myItem:TransformItem = myManager.getItem(myDisplayObject); (that assumes you've already used the addItem() at some point to add the DisplayObject to the TransformManager instance) Does that clear things up?
  22. When you attachMovie() clips, they are always attached at _x:0 and _y:0 according to the registration point of their parent. In this case, if your my_mc MovieClip is offset from the origin of the stage, so will its child clip that you just attached. Make sense?
  23. Yeah, sorry, but I'm absolutely swamped with work and have several deadlines I'm working against, so I don't have time to troubleshoot your FLA, especially since it sounds like the problem is unrelated to TransformManager. Maybe someone else on the forum can help out, though, so feel free to post your FLA. But do NOT post the TransformManager class files! (it would violate the EULA) Good luck!
  24. TransformManager doesn't interfere with text formatting at all. If you're not able to apply text formatting, it must have to do with something else in your code.
  25. You have several options for preventing the selected object from being deselected. You could have TransformManager ignore particular DisplayObjects (like your form elements) using the addIgnoredObject() method, or try this: 1. Set autoDeselect to false 2. Add a background Sprite (it could have a transparent fill so that it's invisible but still clickable) 3. Add an Event.CLICK listener to that background Sprite that calls your TransformManager’s deselectAll() function. Does that answer your question?
×
×
  • Create New...