Jump to content
Search Community

vvuk

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by vvuk

  1. Thanks, I just couldnt find the old post. Please delete this one
  2. Hi, I have a simple tween: TweenLite.to(_mainWheel.wof, _speed, {rotation:(_suspension*2) + (_prizeIndex * _pieAngle), immediateRender:true, useFrames:false, ease:Expo.easeOut, onUpdate:checkPosition, onStart:removeEventListeners, onComplete:mainAnimationFinished }); So, I`m trying to catch it`s rotation angle using checkPosition which is called onUpdate. private function checkPosition():void { trace (_mainWheel.wof.rotation); } Is there any change I get this value accurate? I`m receiving AS you can notice, first traced value is: -160 and second: -73 which is more than double difference between that two. I simply need that to be accurate so if my start roration position is 0, when I run rotation tween and trace it value i get: Anyway, this problem happens only when I run my tween really fast, so I presume this is only because script cannot render rotation that accurate. What would you suggest as solution for this problem? Thanks
  3. Hi, thank you I`m expecting those numbers to be 1,2,3,4,5,6,7,8,9.....180, -179,-178,-177,-176,-175.. How else I`m supposed to know when to trigger tick sound? What would you suggest?
  4. Hi, here is one I hope simple problem. I`m using tweenlite to simple rotate some stuff and then to trigger some sound when wheel reach a certain position: TweenLite.to(_myWheel, _speed, {rotation:_suspension + (_pieIndex * _pieAngle), immediateRender:true, useFrames:false, ease:easeFunct, onUpdate:playTickSound }); private function playTickSound ():void { trace (Math.round(_myWheel.rotation)); _isWhole = (Math.round(_myWheel.rotation) / Math.round(_pieAngle)) % 1 == 0; if (_isWhole) playSimpleSound(); } To exactly calculate _isWhole = true, I need to have Math.round(_myWheel.rotation) exact position every time when onUpdate occurs. Anyways, for some reason I don`t get those info right, so here is what I get when I try to trace it: trace (Math.round(myWheel.rotation)); 139 156 171 -176 -162 -144 -130 -119 -109 -98 -88 -78 -67 -54 -42 -30 -19 -9 1 11 21 30 39 51 63 76 86 95 103 111 118 126 135 143 150 157 165 172 179 -174 -168 -162 -155 -148 -140 -133 -127 -121 -116 -110 -104 -99 -93 -87 -81 -76 -70 -65 -61 -57 -52 -48 -43 -39 -34 -30 -27 -23 -20 -17 -14 -11 -8 -5 -2 0 2 4 5 7 9 11 12 14 15 16 17 18 19 20 21 21 22 22 22 23
×
×
  • Create New...