Jump to content
Search Community

vvuk

Members
  • Posts

    5
  • Joined

  • Last visited

Posts posted by vvuk

  1. 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

     

     

    -160

    -73

    15

    74

    134

    -165

    -119

    -68

    -28

    5

    39

    75

    110

    139

    173

    -157

    -124

    -96

    -74

     

    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:

     

    0

    1

    2

    3

    ...

    177

    178

    179

    180

    -180

    -181

    ...

     

    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

  2. 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...