flash AS3导出动作数据

import flash.display.MovieClip;

import flash.events.Event;

var info_separator = ",";

var card_x:Number = card.x;

var card_y:Number = card.y;

var card_rotation:Number = card.rotation;

card.addEventListener( Event.ENTER_FRAME, onCardEnterFrame );

function onCardEnterFrame( e:Event ) {

  var card_info:String = "{";

  card_info += Math.round( ( card.x - card_x ) * 100 ) / 100;

  card_info += info_separator;

  card_info += Math.round( ( card_y - card.y ) * 100 ) / 100;

  card_info += info_separator;

  card_info += Math.round( ( card.rotation - card_rotation ) * 100 ) / 100;

  card_info += info_separator;

  card_info += Math.round( ( card.scaleX ) * 100 ) / 100;

  card_info += info_separator;

  card_info += Math.round( ( card.scaleY ) * 100 ) / 100; card_info += "},";

  trace( card_info );

}

posted on 2014-06-05 17:38  the seal  阅读(234)  评论(0编辑  收藏  举报