1

是否可以将 addChild 与 tweener 或转换一起使用,我的意思是不仅将孩子带到舞台上,而且同时使这个动画?

特别是在这种类型的代码中:

var background=new MovieClip  ;
var g:Graphics=background.graphics;
g.lineStyle(2, 0xFFFFFF);
var mat:Matrix;
var alphas:Array;
var ratios:Array;

mat=new Matrix();
alphas=[1,1,1];
ratios=[0,150,255];

mat.createGradientBox(30,19,toRad(-90));
g.beginGradientFill(GradientType.LINEAR,colors,alphas,ratios,mat);
g.drawRoundRect(2, 2, 30, 19, 5);
addChild(background);
4

3 回答 3

0

是的。您将首先 addChild,然后将补间应用到孩子。

于 2012-02-24T17:14:42.347 回答
0

在您的movieclip 对象中,在构造函数中添加事件监听器。我是说

package
{
import flash.display.MovieClip;
import flash.events.Event;

  public class Some extends MovieClip
  {
    public function Some()
    {
      addEventListener(Event.ADDED_TO_STAGE, Added);
    }
    public function Added(e.Event):void
    {
      removeEventListener(Event.ADDED_TO_STAGE, Added);
      addEventListener(Event.ENTER_FRAME, DrawLoop);
    }
    public function Added(e.Event):void
    {
      //here make your showing up effects
    }
  }
}

当然,您需要将对象创建为扩展类

var background:Some = new Some()
//your stuff here
addChild(background);
于 2012-02-24T17:32:25.263 回答
0

使用 tweenlite 或其他东西:http ://www.greensock.com/tweenlite

于 2012-02-27T11:42:58.970 回答