我有一個方法,需要幾個參數,並動態地將三個圖像添加到舞臺上,它也爲這三個圖像添加背景圖像。補間背景然後動態圖像 - AS3閃存
我想弄清楚以下幾點:我如何補間背景動畫片段和完整補間三個動態影片剪輯?我可以在共享相同變量的函數中使用函數嗎?
類似以下內容:
public function addImages(BackGround:String,Image1:String,Image2:String,Image3:String):void
{
var symbol_class:Class = getDefinitionByName(BackGround);
var image1_class:Class = getDefinitionByName(Image1);
var image2_class:Class = getDefinitionByName(Image2);
var image3_class:Class = getDefinitionByName(Image3);
var main_bg = new symbol_class();
var image_1 = new image1_class();
var image_2 = new image2_class();
var image_3 = new image3_class();
main_box.addChild(main_bg);
var BGTween:Tween = new Tween(my_thumb, "alpha", Strong.easeIn, 0,1,0.5, true);
BGTween.addEventListener(TweenEvent.MOTION_FINISH, onFinish);
//WHEN BACKGROUND TWEEN IS COMPLETE NOW ADD THE OTHER IMAGES AND FADE THEM IN.
function onFinish(e:TweenEvent):void {
BGTween.removeEventListener(TweenEvent.MOTION_FINISH, onFinish);
main_box.addChild(image_1);
var image_1_tween:Tween = new Tween(image_1, "alpha", Strong.easeIn, 0,1,0.5, true);
main_box.addChild(image_2);
var image_2_tween:Tween = new Tween(image_2, "alpha", Strong.easeIn, 0,1,0.5, true);
main_box.addChild(image_3);
var image_3_tween:Tween = new Tween(image_3, "alpha", Strong.easeIn, 0,1,0.5, true);
}
}
謝謝,我實際上是從你的迴應得到了幾件事情。謝謝! +1檢查。 – Denoteone 2012-02-28 16:04:44