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. Thanks, I overlooked that total means including repeats.
  2. Can you explain me what is the difference between progress, totalProgress, duration, totalDuration, time, totalTime methods? Is this a good way to complete timeline while it's playing? timeline.seek(timeline.totalDuration());
  3. I am using v12. This could do, but I already found different solution, you can tell me if it's alright. timeline.append(tween1); timeline.append(tween2); timeline.addLabel("tween3", timeline.duration()); timeline.append(tween3); timeline.append(tween4); and to forward I do: timeline.gotoAndPlay("tween3", false);
  4. How do I do forwarding to specific tween in timeline? If I have: timeline.append(tween1); timeline.append(tween2); timeline.append(tween3); timeline.append(tween4); and I want to forward to tween3, how to do that? Also, tween1 and tween2 have tween events that need to be completed before forwarding.
  5. I didn't say it's bad, but for some serious interactive app, it's not. I was using relatively small number of FXG's in relatively complex MXML, and choppy animation is noticable, slower response to starting animation when mouse clicked... That slower performance has to do with event dispatching mostly, and redrawing of FXG's, even though I used as much performance tweeking I could. It's not due to GSAP, which probably is the best solution, but rather Flash not up to task.
  6. I was wondering if anyone has experience in using GSAP in MXML and Sprite so that comparison can be made in performance. I am working at the moment with MXML and I didn't have chance to try GSAP only in Sprite, and I can say that I am not very pleased with speed of executing tweens. I know that there are many factors that can slow down executing tweens, particularly in Flash runtime, but as it stands now, I think that using GSAP in MXML is limited to simpler work, to what extent, I don't know yet.
  7. That is working, but still if I do that, object's movement is again choppy meaning object would jump to 100 and continue to 300, even though code finishes before tween twe starts. Why?
  8. Can you help me with 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/halo" click="starts()"> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> <fx:Script> <![CDATA[ import com.greensock.data.TweenMaxVars; import com.greensock.TweenMax; import com.greensock.events.TweenEvent; import com.greensock.TimelineMax; private var timeline:TimelineMax = new TimelineMax(); private function starts():void { var tweenMaxVars1:TweenMaxVars = new TweenMaxVars(); var twe1:TweenMax = new TweenMax(obj, 10, tweenMaxVars1); twe1.addEventListener(TweenEvent.START, write); var tweenMaxVars:TweenMaxVars = new TweenMaxVars(); tweenMaxVars.x(300); var twe:TweenMax = new TweenMax(obj, 5, tweenMaxVars); timeline.append(twe1); timeline.append(twe); } private function write(event:TweenEvent):void { for (var counter:Number = 0; counter < 3000; counter++) { trace('beforeStart') } trace("finished"); TweenMax(event.target).progress(1); } ]]> </fx:Script> <s:Label id="obj" text="object"/> </s:Application> I tried to end tween twe1 with TweenMax(event.target).progress(1) so that it ends when for command ends, but that doesn't work. How to do that?
  9. I don't mind if 3rd tween finishes 0.1 seconds later, that's not important. Lets make it this way. Can I insert empty tween with duration 0.1 between 2nd and 3rd that will do the code, because I tried that and rendering of 3rd tween still is choppy.
  10. I have a tweens that are in timeline and I need to execute code before one tween in timeline that is going to start after some tweens. Because that tween duration is 0.3 seconds, code that is in TweenEvent.START listener disrupts rendering on screen, so I don't need huge gap, just maybe 0.1 seconds. So for example I need this: TIMELINE: 1. Tween 2. Tween 3. Tween 4. Code 5. Tween
  11. I understand how it works. First solution is no good for me because frame rate can seriously drops and tween must finish in time. Second solution is also no good for me beacuse I don't know when I need to call write() function, if we are looking at real scenario for my app, because there are other tweens, and I just need something like Pre-start event. Can some plugin be written?
  12. On screen object moves from 0 to 70-80 and continues to 300, It doesn't smoothly goes to 300.
  13. Here is example I tried: <?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="starts()"> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> <fx:Script> <![CDATA[ import com.greensock.data.TweenMaxVars; import com.greensock.TweenMax; import com.greensock.events.TweenEvent; import com.greensock.TimelineMax; private function starts():void { var timeline:TimelineMax = new TimelineMax(); var tweenMaxVars:TweenMaxVars = new TweenMaxVars(); tweenMaxVars.x(300); var tweenMaxVars1:TweenMaxVars = new TweenMaxVars(); tweenMaxVars1.onStart(function():void { write(); }); tweenMaxVars.startAt(tweenMaxVars1); var twe:TweenMax = new TweenMax(obj,2, tweenMaxVars); timeline.append(twe); } private function write():void { for (var counter:Number = 0; counter < 3000; counter++) { trace('beforeStart') } } ]]> </fx:Script> <s:Label id="obj" text="object"/> </s:Application> I need that write() function executes completely before tween starts. In this example you can see that tween starts while write() function is still executing, which is what I don't want to happen.
  14. I need to execute some code just before tween starts and then let tween play. I was using TweenEvent.START but actually I need before it starts, some event like PRE-START, STARTING... How to do that?
  15. If I have timeline.stop() how to detect that it's stopped?
  16. No, just on screen is visible (in my case) wrong x,y, width and/or height of FXG's. I will keep track of it, and update as the news are coming...
  17. I'll continue to track this problem, and hopefully get exact description. But problem exists, and as I mentioned, if I don't use setElementIndex() method then tweening is ok, but if I use it, then tweening events can be unsent, and I can I give one more clue to it and that is happening if rendering is going slower, if there's a slow frame rendering, slow animation... I suspect Flash runtime has something to do with it, and if I find exact cause, then it should be taken in consideration.
  18. I have noticed that setElementIndex for tween object can affect tween events in a way such that they are not dispatched. I must say that I can't provide an example because I am not sure when those problems exactly arise, but I have noticed that TweenEvent.UPDATE is not always dispatched if setElementIndex is running at the same time for tween object. I have seen for example that UPDATE is dispatched only once at beginning and never again. setElementIndex() method is using remove and add element to rearrange indexes so probably that's the cause for tween events problems. Also I have noticed that if tween objects have TweenEvent.UPDATE and TweenEvent.COMPLETE events and I do TweenMax.killAll(true) in Event.RESIZE listener, results of completion of code in those tween events listeners are not always equal if they include some movements of tween objects. I don't know if anyone had such problems, but I have done testing and I can't reproduce them in a simple app, but in complex app that I am developing when there is FXG graphics and lots of code behind, those problems are occuring.
  19. I just wrote it in a quicker way to show what change I want. Of course I will use variable instead of a.length in while. I am more interested in functional repercussions of that change, will it affect in any way using GSAP platform.
  20. I have been looking at TweenMax.as code and I have found a reason for described behaviour. Code for function TweenMax.killAll(true) is: public static function killAll(complete:Boolean=false, tweens:Boolean=true, delayedCalls:Boolean=true, timelines:Boolean=true):void { var a:Array = getAllTweens(timelines), i:int = a.length, isDC:Boolean, allTrue:Boolean = (tweens && delayedCalls && timelines), tween:Animation; while (--i > -1) { tween = a[i]; if (allTrue || (tween is SimpleTimeline) || ((isDC = (TweenLite(tween).target == TweenLite(tween).vars.onComplete)) && delayedCalls) || (tweens && !isDC)) { if (complete) { tween.totalTime(tween.totalDuration()); } else { tween._enabled(false, false); } } } } Line 7 while (--i > -1) is iterating a:Array backwards causing tweens to be completed in reversed order from which they are added. If I change line 3 i:int = a.length to i:int = 0 and line 7 while (--i > -1) to while (i < a.length) (and adding i++ to the end of loop) then tweens are completed in appended order and tween event listeners are triggered in appended order. I want to know if this change is ok, will it have negative reflection on something? Thanks.
  21. If I do TweenMax.kilAll(true) then TweenMax event listeners function doesn't end in order. For example, if I have this code: var timeline:TimelineMax = new TimelineMax(); var tweenMax:TweenMax = new TweenMax(obj, 5, { x:200, y:200 } ); tweenMax.addEventListener(TweenEvent.START, function():void { trace("Start"); }); tweenMax.addEventListener(TweenEvent.UPDATE, function():void { trace("Update"); }); tweenMax.addEventListener(TweenEvent.COMPLETE, function():void { trace("Complete"); }); var tweenMax1:TweenMax = new TweenMax(obj, 5, { x:300, y:300 } ); tweenMax1.addEventListener(TweenEvent.START, function():void { trace("Start1"); }); tweenMax1.addEventListener(TweenEvent.UPDATE, function():void { trace("Update1"); }); tweenMax1.addEventListener(TweenEvent.COMPLETE, function():void { trace("Complete1"); }); timeline.append(tweenMax); timeline.append(tweenMax1); If I do killAll(true) while tweenMax is playing then I get following order of event listneres triggered: Start1 Update1 Complete1 Update Complete which means that tweenMax1 event listeners are triggered first and then tweenMax event listeners. I thought that order of events would be: Update Complete Start1 Update1 Complete1 because order of timeline appends is tweenMax and then tweenMax1.
  22. I tried it, and again it's giving me trace and trace and trace and trace... Just kidding, it's ok now.
  23. I test it, and obviously .as files are not compiled, meaning greensock.swc version is older then .as files. .as files doesn't show trace statements while greensock.swc does. Again, I am urging you not to publish unsync versions of .as and greensock.swc file, it just brings unnecessary confusion.
×
×
  • Create New...