AnimatorEvent.CYCLE_COMPLETE

Software: Away3D 4.x

redviper, Newbie
Posted: 11 June 2013 02:55 AM   Total Posts: 2

Hallo!
Although I was poor at English, since I discovered the bug, I report.

Condition:An event can be stabilized and cannot dispatch.

version 4.1.1

class:SkeletonClipState

method:
override protected function updateFrames() : void
{
  super.updateFrames();
  _currentPose = _frames[_currentFrame];

  trace(_oldFrame, _currentFrame, _nextFrame)
  // Depending on the conditions of a frame rate, the following frame cannot necessarily detect the last frame.
  if (_skeletonClipNode.looping && _nextFrame >= _skeletonClipNode.lastFrame){
  _nextPose = _frames[0];
  SkeletonAnimator(_animator).dispatchCycleEvent();
  } else {
  _nextPose = _frames[_nextFrame];
  }
}

Draft amendment:
override protected function updateFrames() : void
{
  super.updateFrames();

  _currentPose = _frames[_currentFrame];
  trace(_oldFrame, _currentFrame, _nextFrame)

  if (_skeletonClipNode.looping && _nextFrame >= _skeletonClipNode.lastFrame || _oldFrame > _currentFrame){
  _nextPose = _frames[0];
  // The processing which moves to the last frame is required here.

  SkeletonAnimator(_animator).dispatchCycleEvent();
  } else {
  _nextPose = _frames[_nextFrame];
  }
}

 

   

redviper, Newbie
Posted: 11 June 2013 07:32 AM   Total Posts: 2   [ # 1 ]

Self-solution was carried out.

var node:SkeletonClipNode = _skeletonAnimator.activeAnimation as SkeletonClipNode;

node.looping = false;

node.addEventListener(AnimationStateEvent.PLAYBACK_COMPLETE, onPlaybackComplete);

function onPlaybackComplete(e:AnimationStateEvent):void{
  _skeletonAnimator.reset(node.name);
}

seems that a preview AnimatorEvent.CYCLE_COMPLETE event has another use.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X