Jump to content
Search Community

moxol last won the day on August 29 2012

moxol had the most liked content!

moxol

Members
  • Posts

    63
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by moxol

  1. If it's of help, code that is giving me trace statements is: <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/halo" click="onc()"> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> <fx:Script> <![CDATA[ import com.greensock.TweenMax; import com.greensock.TimelineMax; import com.greensock.data.TweenMaxVars; import com.greensock.easing.*; private function onc():void { lblObj.y = 100; var tweenMaxVars1:TweenMaxVars = new TweenMaxVars(); tweenMaxVars1.y(-10,true); tweenMaxVars1.autoAlpha(1); tweenMaxVars1.ease(Quart.easeOut); var tweenMax1:TweenMax = new TweenMax(lblObj, 1, tweenMaxVars1); var tweenMaxVars2:TweenMaxVars = new TweenMaxVars(); tweenMaxVars2.y(-10,true); tweenMaxVars2.autoAlpha(0); tweenMaxVars2.ease(Quart.easeOut); var tweenMax2:TweenMax = new TweenMax(lblObj, 1, tweenMaxVars2); var timeline:TimelineMax = new TimelineMax(); timeline.append(tweenMax1); timeline.append(tweenMax2); } ]]> </fx:Script> <s:Label id="lblObj" x="200" y="100" fontSize="80" text="A" alpha="0" /> </s:Application> Click anywhere on stage.
  2. I download AS3 version from http://www.greensock.com/v12/ trace() statements are still there. I just tried now. Let me just be clear. Maybe you are reffering to .as files. I am using greensok.swc.
  3. I download it now, and greensock.swc is printing out all trace calls (y, scaleX...)
  4. Please check left over trace statement inTweenMaxVars.y() method. I get: "y from 100 + -10, rel: -=10" By the way, greensock.swc file is working now for relative y. Thanks.
  5. In file VERSION: 12.01, but I always use greensock.swc. Please, always build identical versions of swc's with files.
  6. I just download it , and bug is still there.
  7. Is that version available for download?
  8. I have question again regarding relative move. I tried tweenMaxVars.y(-10, true); var tweenMax:TweenMax = new TweenMax(obj, 1, tweenMaxVars1); and I thought y value will go -10, meaning object will go up, but instead it goes down, and value y is increasing instead of decreasing. Why?
  9. Sorry, you are right, I mixed up something. It's alright, thanks.
  10. I used TweenMaxVars.scale(2, true) and expected that scale goes from 2 like TweenMax.from() function but it doesn't scale FROM 2 to but TO 2. Why?
  11. Excellent! Thanks, you are really attentive. This kind of support I haven't seen anywhere, even on high cost commercial sites. Every problem that I've encountered using Greensock has been solved.
  12. I am using often TweenMaxVars to pass toTweenMax, but then I wouldn't be able to add CompleteRender, right?
  13. This seems to be working fine now, I will test it of course bit more, but for now it looks ok. Can I add event listener directly to TweenMax variable? For example: var tweenMax:TweenMax = new TweenMax(lbl, 0.2, { x:200 } ); tweenMax.addEventListener(TweenEvent.COMPLETERENDER, myFunction);
  14. This is going little bit confusing. Let's keep it simple. Let's start from this example: <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" click="onClick()" > <fx:Script> <![CDATA[ import com.greensock.TimelineMax; import com.greensock.TweenMax; import com.greensock.data.TweenMaxVars; import com.greensock.events.TweenEvent; import flash.events.Event; import com.greensock.plugins.TweenPlugin; import com.greensock.plugins.OnCompleteRenderPlugin; private function onClick():void { TweenPlugin.activate([OnCompleteRenderPlugin]); TweenMax.to(lbl, 0.2, { x:200, onCompleteRender:test } ); } private function test():void { for (var counter:Number = 0; counter < 1000; counter++) { trace('test'); } } ]]> </fx:Script> <s:Label id="lbl" text="object" /> </s:Application> onCompleteRender event is fired just 1,2 px before lbl reaches x = 200, in screen it stops and runs test() function and then finally on screen reaches 200 px. I expected that first on screen reaches 200 px and then runs test() function. P.S. Don't click more then once, just stick to first movement to 200 px, just for testing.
  15. I want to re-render FXG and then cache it as bitmap, but I am not sure how to that manually. I read somewhere on Adobe help that bitmap image are snapped to +-1px, it doesn't have anything to do with stroke. Inner parts of images are also not aligned. You couldn't see that in example since inner image is white, but I saw more complex FXG's are distorted when tweened.
  16. I thought that adding { cacheAsBitmap = false; cacheAsBitmap = true; } in TweenEvent.COMPLETE would redraw and re-cache but sometimes it does, sometimes it doesn't. Is there some method to manual re-cache as bitmap?
  17. Here is the example of this problem. Just click anywhere on stage to tween fxg's and you will see that edges of fxg are not aligned. Cause of this problem is cacheAsBitmap=true. Edge.zip
  18. But Carl's example in Reply #2 works without setting timeline's time. He wrote: " Regardless of whether or not the timeline is done playing, the newly added tweens will always play at the right time without forcing the timeline to play()" I didn't mention one thing, and that is that my timeline has autoRemoveChildren=true. I think Carl's example works because autoRemoveChildren=false; myTimeline.seek(myTimeline.time()) is working for me, but I will test it more so that I can be sure. Thanks for explanation.
  19. No, COMPLETE still fires before actual rendering is not complete. Please look at this example and make plugin according to this: <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" click="onClick()" > <fx:Script> <![CDATA[ import com.greensock.TimelineMax; import com.greensock.TweenMax; import com.greensock.data.TweenMaxVars; import com.greensock.events.TweenEvent; import flash.events.Event; private var timeline:TimelineMax = new TimelineMax(); private function onClick():void { var tweenMaxVars:TweenMaxVars = new TweenMaxVars(); tweenMaxVars.x(200, true); var tweenMax:TweenMax = new TweenMax(lbl, 0.2, tweenMaxVars); timeline.addEventListener(TweenEvent.COMPLETE, function():void { lbl.addEventListener(Event.RENDER, onRender); }); timeline.append(tweenMax); } private function onRender(event:*):void { trace("RENDER: " + lbl.x); if (lbl.x == 200) { lbl.addEventListener(Event.EXIT_FRAME, onExitFrame); } } private function onExitFrame(event:*):void { trace("EXIT FRAME: " + lbl.x); if (lbl.x == 200) { test(); lbl.removeEventListener(Event.RENDER, onRender); lbl.removeEventListener(Event.EXIT_FRAME, onExitFrame); } } private function test():void { for (var counter:Number = 0; counter < 1000; counter++) { trace('test'); } } ]]> </fx:Script> <s:Label id="lbl" text="object" /> </s:Application> Previous example uses event listeners on Timeline, and that works, but same solution doesn't always work on TweenMax, meaning that COMPLETE event on TweenMax sometimes fires after rendering is complete. Here is example, and you will see that test() function sometimes never runs: <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" click="onClick()" > <fx:Script> <![CDATA[ import com.greensock.TimelineMax; import com.greensock.TweenMax; import com.greensock.data.TweenMaxVars; import com.greensock.events.TweenEvent; import flash.events.Event; private function onClick():void { var tweenMaxVars:TweenMaxVars = new TweenMaxVars(); tweenMaxVars.x(200, true); var tweenMax:TweenMax = new TweenMax(lbl, 0.2, tweenMaxVars); tweenMax.addEventListener(TweenEvent.COMPLETE, function():void { lbl.addEventListener(Event.RENDER, onRender); }); tweenMax.play(); } private function onRender(event:*):void { trace("RENDER: " + lbl.x); if (lbl.x == 200) { lbl.addEventListener(Event.EXIT_FRAME, onExitFrame); } } private function onExitFrame(event:*):void { trace("EXIT FRAME: " + lbl.x); if (lbl.x == 200) { test(); lbl.removeEventListener(Event.RENDER, onRender); lbl.removeEventListener(Event.EXIT_FRAME, onExitFrame); } } private function test():void { for (var counter:Number = 0; counter < 1000; counter++) { trace('test'); } } ]]> </fx:Script> <s:Label id="lbl" text="object" /> </s:Application> I am sure if you make plugin such that COMPLETERENDER event is fired like in first example, then it will work.
  20. I think tweening is first and most associated with graphics and animation, so it would make sense to make one more event like RENDERCOMPLETE that would fire after tween is finished on screen and not just on values because I think it's important and I think many developers would benefit. This way I must add RENDER event listener inside COMPLETE event listener, and in RENDER I must add EXIT_FRAME listener because RENDER is just start of rendering and after EXIT_FRAME I can be sure that tween values are rendered on screen. I have test it and it's the right way, but it's very ugly solution.
  21. I have noticed that TweenEvent.COMPLETE fires just before animation finishes. In the provided example you can see that object stops tweening just before COMPLETE is fired. When COMPLETE function event is finished, object reaches it's final tween position. Sometimes COMPLETE fires 1 px before end and sometimes more. I have added RENDER event to prove that actually object final position is reached after COMPLETE event. Can that be solved? <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="[url="http://ns.adobe.com/mxml/2009"]http://ns.adobe.com/mxml/2009[/url]" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" click="onClick()" > <fx:Script> <![CDATA[ import com.greensock.TimelineMax; import com.greensock.TweenMax; import com.greensock.data.TweenMaxVars; import com.greensock.events.TweenEvent; import flash.events.Event; private var timeline:TimelineMax = new TimelineMax(); private function onClick():void { var tweenMaxVars:TweenMaxVars = new TweenMaxVars(); tweenMaxVars.x(200, true); lbl.addEventListener(Event.RENDER, onRender); timeline.addEventListener(TweenEvent.COMPLETE, function():void { for (var counter:Number = 0; counter < 1000; counter++) { trace('test'); } }); var tweenMax:TweenMax = new TweenMax(lbl, 0.2, tweenMaxVars); timeline.append(tweenMax); } private function onRender(event:*):void { trace(lbl.x); if (lbl.x == 200) { lbl.removeEventListener(Event.RENDER, onRender); } } ]]> </fx:Script> <s:Label id="lbl" text="object" /> </s:Application>
  22. I have a TweenMax with duration of 0.4 seconds. Immediatelly after TweenMax there are new function calls to some objects. Since those function calls take some time, TweenMax doesn't animate object but finishes tweening without animation. I understand why is that happening, but is there some solution to this, so that animation runs smoothely?
  23. I have tried this simple test, and it works, but my program is lot more complex and there it doesn't work. I have tried both v11 and v12 but they don't play newly appended TweenMax unless I do manual restart.
  24. OK, when do you expect final v12 to be released?
×
×
  • Create New...