我是flash新手,不幸的是,我們的老師並沒有教會我們如何進行轉換。我試圖研究它們,似乎有100種方法可以做到這一點。在我的例子中,我還沒有找到一個有效的方法。我怎樣才能加載圖片之間的過渡?Flash Actionscript 3.0中的轉換
import flash.display.Loader;
import flash.net.URLRequest;
import flash.events.MouseEvent;
import fl.transitions.*;
import fl.transitions.easing.*;
home_btn.addEventListener(MouseEvent.CLICK, takeToHomeZerg);
sarahkerrigan_btn.addEventListener(MouseEvent.CLICK, addsarahkerrigan);
izsha_btn.addEventListener(MouseEvent.CLICK, addizsha);
abathur_btn.addEventListener(MouseEvent.CLICK, addabathur);
var sarahkerriganAdd:Loader = new Loader();
var izshaAdd:Loader = new Loader();
var abathurAdd:Loader = new Loader();
var sarahkerrigan:URLRequest = new URLRequest("zerg/sarahkerrigan.jpg");
var izsha:URLRequest = new URLRequest("zerg/izsha.jpg");
var abathur:URLRequest = new URLRequest("zerg/abathur.jpg");
sarahkerriganAdd.visible = false;
izshaAdd.visible = false;
abathurAdd.visible = false;
addChild(sarahkerriganAdd);
addChild(izshaAdd);
addChild (abathurAdd);
function takeToHomeZerg (evt:MouseEvent):void{
gotoAndStop(1);
removeChild(sarahkerriganAdd);
removeChild(izshaAdd);
removeChild (abathurAdd);
}
function addsarahkerrigan (evt:MouseEvent):void{
sarahkerriganAdd.load(sarahkerrigan);
sarahkerriganAdd.x = 275;
sarahkerriganAdd.y = 32;
sarahkerriganAdd.scaleX = .2618;
sarahkerriganAdd.scaleY = .28;
sarahkerriganAdd.visible = true;
izshaAdd.visible = false;
abathurAdd.visible = false;
}
function addizsha (evt:MouseEvent):void{
izshaAdd.load(izsha);
izshaAdd.x = 275;
izshaAdd.y = 32;
izshaAdd.scaleX = .2618;
izshaAdd.scaleY = .28;
izshaAdd.visible = true;
sarahkerriganAdd.visible = false;
abathurAdd.visible = false;
}
function addabathur (evt:MouseEvent):void{
abathurAdd.load(abathur);
abathurAdd.x = 275;
abathurAdd.y = 32;
abathurAdd.scaleX = .2618;
abathurAdd.scaleY = .28;
abathurAdd.visible = true;
izshaAdd.visible = false;
sarahkerriganAdd.visible = false;
}