我是 Flash 新手,不幸的是我们的老师没有教我们如何进行过渡。我曾尝试研究它们,似乎有 100 种方法可以做到这一点。在我的例子中,我还没有找到有效的方法。如何在正在加载的图片之间进行过渡?
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;
}