Starling中MovieClip倒序,反向播放

阅读更多
关于Starling中的MovieClip反向、倒序播放实现

暂时想到的,修改内容最少的方法了

package com.liyunpeng.xxx
{
	import flash.media.Sound;
	
	import starling.animation.IAnimatable;
	import starling.display.MovieClip;
	import starling.textures.Texture;
	
	public class MMovieClip extends MovieClip implements IAnimatable
	{
		private var _isReverse:Boolean = false;
		
		public function MMovieClip(textures:Vector., fps:Number=12)
		{
			super(textures,fps);
		}
		
		public function set isReverse(value:Boolean):void
		{
			if(this._isReverse != value) {
				var numFrames:int = this.numFrames;
				
				var mTextures:Vector. = new Vector.();
				var mSounds:Vector. = new Vector.();
				var mDurations:Vector. = new Vector.();
				
				for(var i:int=numFrames-1;i>=0;i--) {
					mTextures.push(this.getFrameTexture(i));
					mSounds.push(this.getFrameSound(i));
					mDurations.push(this.getFrameDuration(i));
				}
				
				for(var j:int=0;j 

你可能感兴趣的:(Starling,MovieClip,倒序)