|
您好...日前參考了貴社所出版的快樂學flash cs3當中的像簿製作方式...製作出了一頁像簿...
可是由於小弟的相片數量比較多...因此我用了第二個影格以及加上按鈕製作...
卻出現了錯誤的訊息 不知道該從和解決...因次特來請教...
以下是我的程式碼 第一影格 var totalNum:Number=8; var i:Number; show_mc.gotoAndStop(1);
for (i=1; i<=totalNum; i++) { this["show"+i+"_mc"].photoNum =i; this["show"+i+"_mc"].buttonMode =true; this["show" + i + "_mc"].gotoAndStop(i); this["show"+i+"_mc"].alpha =0.5; this["show" + i + "_mc"].addEventListener(MouseEvent.MOUSE_OVER,showOver); this["show" + i + "_mc"].addEventListener(MouseEvent.MOUSE_OUT,showOut); this["show" + i + "_mc"].addEventListener(MouseEvent.CLICK,showClick); }
function showOver(event:MouseEvent):void { event.target.alpha =1; }
function showOut(event:MouseEvent):void { event.target.alpha =0.5; }
function showClick(event:MouseEvent):void { show_mc.alpha =0; show_mc.gotoAndStop(event.target.photoNum); show_mc.addEventListener(Event.ENTER_FRAME,showPhoto); }
function showPhoto(event:Event):void { show_mc.alpha +=0.1; }
if (show_mc.alpha>1) { show_mc.alpha =1; show_mc.removeEventListener(Event.ENTER_FRAME,showPhoto); }
this.stop();
function nex_btn(event:MouseEvent):void { nextFrame(); } this.but01_btn.addEventListener(MouseEvent.CLICK,nex_btn);
以下是第二影格 var totalNum2:Number=2; var j:Number; show_mc2.gotoAndStop(1);
for (j=1; j<=totalNum2; j++) { this["show"+j+"_mc2"].photoNum2 =j; this["show"+j+"_mc2"].buttonMode =true; this["show" + j + "_mc2"].gotoAndStop(j); this["show"+j+"_mc2"].alpha =0.5; this["show" + j + "_mc2"].addEventListener(MouseEvent.MOUSE_OVER,showOver2); this["show" + j + "_mc2"].addEventListener(MouseEvent.MOUSE_OUT,showOut2); this["show" + j + "_mc2"].addEventListener(MouseEvent.CLICK,showClick2); }
function showOver2(event:MouseEvent):void { event.target.alpha =1; }
function showOut2(event:MouseEvent):void { event.target.alpha =0.5; }
function showClick2(event:MouseEvent):void { show_mc2.alpha =0; show_mc2.gotoAndStop(event.target.photoNum2); show_mc2.addEventListener(Event.ENTER_FRAME,showPhoto2); }
function showPhoto2(event:Event):void { show_mc2.alpha +=0.1; }
if (show_mc2.alpha>1) { show_mc2.alpha =1; show_mc2.removeEventListener(Event.ENTER_FRAME,showPhoto2); }
this.stop();
function bak_btn(event:MouseEvent):void { prevFrame(); } this.but02_btn.addEventListener(MouseEvent.CLICK,bak_btn);
以下是出現錯誤的訊息 TypeError: Error #1009: 無法存取 Null 物件參考的屬性或方法。at mimilee_fla::MainTimeline/showPhoto()
===== 以上..煩請協助了...感恩... |