Jump to content
Search Community

szaqal

Members
  • Posts

    19
  • Joined

  • Last visited

szaqal's Achievements

0

Reputation

  1. This is exactly what I was trying to achieve. One more time thanks Jack .
  2. I've created a custom CirclePath2D class in with I've overridden the set progress function (see attached) so that I could calculate the progress change on flight. I'm tweening the progress value like this: var direction:String = Direction.COUNTER_CLOCKWISE; var progress_change:Number = -0.08333333; // it can also be -2.5 or 0.012222222 - it is beeing calculated dynamically TweenLite.to(circle_motion_path, 2, {progress: circle_motion_path.progress + progress_change, onStart: motionPathDirection, onStartParams: [direction]}); //circle_motion_path is CustomCirclePath2D object //circle_motion_path.progress is 0 on start private function motionPathDirection(direction:String):void { circle_motion_path.direction = direction; } In onStart function I'm setting manually the direction of progress change to "tell" what kind on calculations should be made in overridden set progress function. But this doesn't always work well as I've made it. Especially when quick jumping from progress: 0 to progress: -1.25. Is it clearer now? Please chech this link to see the example: http://pszajna.ires.pl/index.html maybe it will explain the problem better. Each time I'm jumping to next point I want to calculate how the progress value changes from point 0 to point 1.
  3. Jack one more thing about MotionPath. How can I calculate "rotation" value of MotionPath? By "rotation" I mean the number of full revolutions based on progress value change. So lets say if I'm changeing the progress from 0 to -0.0833333 TweenLite.to(circle_motion_path, 2, {progress: circle_motion_path.progress + (-0.0833333)}); //circle_motion_path.progress is 0 the "rotation" value should be 0.083333 and so on. In other words CCW direction should increase "rotation" value and CC should decrease it. Could You give me some advice how can I achieve that?
  4. Yep, I've found many articles about it. In my case it's generating a random error because I've a conditional like this: if(progress > 1 && progress < 0) { ... } else { // very important actions } and it is very important for me that progress is 0 not "almost" 0. I've fixed this by rounding progress prop to 12 decimal places. I hope it will work.
  5. hi I'm getting a weird progress value after tweening MotionPath progress property. I've created a CirclePath2D object (it progress prop is set to 0). Next I've calculated the progress change value: var progress_change:Number = circle_motion_path.anglesToProgressChange(circle_motion_path.progressToAngle(circle_motion_path.progress), -1110, Direction.COUNTER_CLOCKWISE); // result: -0.08333333333333333 Finally I'm tweening: TweenLite.to(circle_motion_path, 5, {progress: circle_motion_path.progress + progress_change, onComplete: navigationToStopComplete}); and trace'ing the circle_motion_path.progress prop in the navigationToStopComplete function results: 329.99999999999994 instead of 330. I'm guessing that this has something to do with the floating point math but I'm not sure. How can it be fixed? Please help.
  6. Yep, I was thinking about this solution and if you also suggest something like this I will use it . It will help me with some other things I've got to handle. Thanks for help
  7. Jack shouldn't the f.cachedProgress in progress setter (in MotionPath class) be also changed to f.progress? The new class works fine when I add followers but when tweening nothing happenes. The distribute function also modifies f.cachedProgress.
  8. Because I've extended the PathFollower class to monitor the progress property in the progress setter. I'm building a carousel and I want to manage elements by PathFollower progress property like: override public function set progress(value:Number):void { super.progress = value; if(super.progress < 0.75) { super.target.alpha = 0; } } My current concept is that each of the pathFollowers should monitor its progress and perform actions on their targets. Jack if you have any suggestions how to achieve that please give me a tip .
  9. Hi Jack. Why are You using the: f.cachedProgress property rather than f.progress in the addFollower function in the MotionPath class?
  10. Thanks for help Jack. I'm downloading the latest ver. Cheers
  11. hi I'm trying to create an oval motion path by this code: var circle_motion_path:CirclePath2D = new CirclePath2D(100, 100, 50); circle_motion_path.height = 100; trace(circle_motion_path.height); // results 0 what am I doing wrong?
  12. Thank you for answering my questions.
  13. Yes, that makes sens and answers my question but I've got one more is it possible to set onComplete handler other way then in constructor vars properties. Let's say that I want to call load() several times on the same loader object but with diffrent onComplete handlers and I don't want to call the whole constructor method each time but only set the new url and new onComplete handler like: var img_loader = new ImageLoader(imagePath, {name: "logo", container: logo_container, x: 0, y: 0, width: 50, height: 27, scaleMode: "proportionalInside", centerRegistration: true, onIOError: onLogoLoadError, onComplete: onLogoLoadComplete}); img_loader.load(); function onLogoLoadComplete(le:LoaderEvent):void { img_loader.url = "some_url"; img_loader.onComplete = newOnCompleteHandler; img_loader.load(true); }
  14. Not exactly autoDisposse: true fires dispose() automaticly onComplete that's clear to me. But is dispose() fired when loader dispatches IO_ERROR event or do I have to do it manually? What happenes then to the loader I mean after IO_ERROR occurs? Now I'm making it eligible for GC by this code private function onLogoLoadError(le:LoaderEvent):void { img_loader.dispose(); img_loader = null; } is that ok? My previous question wasn't clear enough I think .
×
×
  • Create New...