我有一个带有翻页效果的书的脚本。但是当我从右向左翻转页面时,页面背面的白色是页面正面的反射。你知道你让它变白吗?
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
import flash.display.Sprite;
import flash.display.Loader;
var cont:DisplayObject;
var cont2:DisplayObject;
var imgLoader:Loader;
var pages:Array = [];
for (var i:int=0; i<=4; i++)
{
imgLoader = new Loader();
imgLoader.contentLoaderInfo.addEventListener(Event.INIT, onLoadJPEG);
imgLoader.load(new URLRequest(""+i+".png"));
}
var imgLoader2:Loader;
imgLoader2 = new Loader();
imgLoader2.contentLoaderInfo.addEventListener(Event.INIT, onLoadSketch);
imgLoader2.load(new URLRequest("voltaatrassketchbook.png"));
function onLoadJPEG(e : Event):void
{
cont = e.target.loader;//obter o loader associado ao LoaderInfo
cont.x = 250;
cont.y = 50;
cont.width = (445 - 100) / 2;
cont.height = (604 - 100) / 2;
addChild(cont);
cont.addEventListener(MouseEvent.MOUSE_UP, FlipPage);
pages.push(cont);
}
function onLoadSketch(e : Event):void
{
cont2 = e.target.loader;//obter o loader associado ao LoaderInfo
cont2.x = 450;
cont2.y = 300;
cont2.width = 181 / 2;
cont2.height = 127 / 2;
addChild(cont2);
cont2.addEventListener(MouseEvent.MOUSE_UP, volta);
}
function FlipPage(e:MouseEvent):void
{
setChildIndex(DisplayObject(e.currentTarget), this.numChildren - 1);
if (e.currentTarget.rotationY == 0)
{
var myTween:Tween = new Tween(e.currentTarget,"rotationY",Regular.easeInOut,0,180,1,true);
}
if (e.currentTarget.rotationY == 180)
{
var myTween:Tween = new Tween(e.currentTarget,"rotationY",Regular.easeInOut,180,0,1,true);
}
}
function volta(e: MouseEvent):void
{
gotoAndStop(1);
for (var i:int = 0; i < pages.length; i++)
{
DisplayObject(pages[i]).visible = false;
}
cont2.visible = false;
}