Jump to content
Search Community

viatropos

Members
  • Posts

    8
  • Joined

  • Last visited

viatropos's Achievements

0

Reputation

  1. Perfect, that's it . Thanks man, Lance
  2. Hey Jack, That method does work, thanks, but I would like to make it a plugin. By "intercept the setting of the properties", I mean I need a layer in between the HexColorPlugin/BezierPlugin/SetActualSizePlugin/[OtherPluginsThatUseMethods]Plugin. So if I do {style:{hexColors:{backgroundColor:red}}}, it would build something like this: TweenMax StylePlugin HexColorPlugin Instead of... TweenMax HexColorPlugin That way, in the StylePlugin, I could just create a new HexColorPlugin if I saw "hexColors" in the "style" Object, and it would do what it's supposed to do. The issue is, that logic is in the TweenLite.init() method, where the Plugin is actually created, so the architecture only allows you to go one layer deep. By "one layer", I mean the tree above. So what if I wanted to bezier-tween the "setStyle" for "backgroundColor". Instead of using the "onUpdate" function and re-creating the BezierPlugin and HexColorPlugin logic, I could just do this: TweenMax BezierPlugin StylePlugin HexColorPlugin ... from this object: TweenMax.to(target, 1, {bezier:{style:{hexColors:{backgroundColor:red}}}}); So the first layer, BezierPlugin, would see "style", so it would create a StylePlugin. Then the StylePlugin would see "hexColors", and would create the HexColorPlugin, and so on, infinitely. That way I could re-use the existing plugins without reverting to "onUpdate". That's what I mean by "intercept the setting of the properties". If there was a logic like that built in, I could do a ton with reusing the existing plugins, and having plugins invoke other plugins. Is that possible? What would it take? Thanks, Lance P.S. While that bezier example can probably be done differently, I'm just looking to create a more flexible TweenPlugin system that allows Plugins to use/instantiate other Plugins
  3. I would like to be able to tween things like "backgroundColor" in Flex, which can only be changed via "setStyle". I thought about making a TweenPlugin to do this, but I need to intercept the setting of the properties on all the other TweenPlugins which I am unsure of how to do. Could you please point me in the right direction? I'm running into this same problem when I want to bezier tween methods, because I'd have to intercept 5 or 10 tween plugins that use methods and allow them to receive bezier values. Something like this for tweening styles; TweenMax.to(target, 1, {x:100, style:{hexColors:{backgroundColor:0xff0000}}}); Any ideas? Thanks!
  4. I can solve it by just killing the timeline, storing that in a Dictionary/Object. Not super clean, but it works protected static var masterLabelList:Object = {}; protected function constructTimeline(options:Object):void { var label:String = (options && "label" in options) ? options.label : null; remove(label); timeline = new TimelineMax(); add(label); } protected function remove(label:String):void { if (!label || !timeline) return; var timelines:Array = masterLabelList[label]; if (!timelines) return; var children:Array; var i:int = 0; var n:int = timelines.length; var j:int; var q:int; for (i; i < n; i++) { children = timelines[i].getChildren(); j = 0; q = children.length; for (j; j < q; j++) { children[j].kill(); } } } protected function add(label:String):void { if (!label || !timeline) return; masterLabelList[label] ||= []; masterLabelList[label].push(timeline); } Thanks, Lance
  5. Hey, I would like to be able to kill the tweens of an object based on what the tween is doing, preferably by a "label" or something. So if I have one object, as Square, and I'm tweening it using two separate TimelineLites, one tweening the position, the other tweening the scale (scale is tweened on rollover, position is tweened on click), such as: var timeline:TimelineLite = new TimelineLite(); timeline.append(TweenLite.to(square, 1, {x:1000})); timeline.append(TweenLite.to(square, 1, {y:1000})); timeline= new TimelineLite(); timeline.append(TweenLite.to(square, 1, {scaleX:2, scaleY:2})); ...and I want to use TweenMax.killTweensOf(square) on every rollover/click, how do I make it so it only kills the click tweens on click, and rollover tweens on rollover? Is this built in, or do I have to manually manage it? This is a basic example so there's probably other ways to do it, but I have some pretty complex tweens, and maybe 5 different timelines for an object, and I only want to kill one of the timelines on overwrite, how do I do that? Basically, I would just like to prevent onComplete being called if the tween is interrupted... Thanks! Lance
  6. It would just take the BitmapData, tween that (maybe remove the original child), then when the tween is complete, remove the BitmapData, add the child back.
  7. Is there a TweenMax plugin that takes a bitmap snapshot of the component and converts it back? That would be very helpful.
×
×
  • Create New...