import flash.display.Loader; import flash.net.URLRequest; import flash.events.MouseEvent; // 載入預設圖片 var dfPIC:Loader = new Loader(); dfPIC.load(new URLRequest("photos/menu1_1.jpg")); loader_mc.addChild(dfPIC); var L1:Loader = new Loader(); L1.load(new URLRequest("photos/menu1_1.jpg")); b1_btn.addEventListener(MouseEvent.CLICK, load_pic1); function load_pic1(event:MouseEvent):void { loader_mc.addChild(L1); } var L2:Loader = new Loader(); L2.load(new URLRequest("photos/menu1_2.jpg")); b2_btn.addEventListener(MouseEvent.CLICK, load_pic2); function load_pic2(event:MouseEvent):void { loader_mc.addChild(L2); } var L3:Loader = new Loader(); L3.load(new URLRequest("photos/menu1_3.jpg")); b3_btn.addEventListener(MouseEvent.CLICK, load_pic3); function load_pic3(event:MouseEvent):void { loader_mc.addChild(L3); } var L4:Loader = new Loader(); L4.load(new URLRequest("photos/menu1_4.jpg")); b4_btn.addEventListener(MouseEvent.CLICK, load_pic4); function load_pic4(event:MouseEvent):void { loader_mc.addChild(L4); } var L5:Loader = new Loader(); L5.load(new URLRequest("photos/menu1_5.jpg")); b5_btn.addEventListener(MouseEvent.CLICK, load_pic5); function load_pic5(event:MouseEvent):void { loader_mc.addChild(L5); } var L6:Loader = new Loader(); L6.load(new URLRequest("photos/menu1_6.jpg")); b6_btn.addEventListener(MouseEvent.CLICK, load_pic6); function load_pic6(event:MouseEvent):void { loader_mc.addChild(L6); } var L7:Loader = new Loader(); L7.load(new URLRequest("photos/menu1_7.jpg")); b7_btn.addEventListener(MouseEvent.CLICK, load_pic7); function load_pic7(event:MouseEvent):void { loader_mc.addChild(L7); }