home *** CD-ROM | disk | FTP | other *** search
- package Gamefile
- {
- import flash.display.MovieClip;
- import flash.events.Event;
- import flash.events.MouseEvent;
- import flash.net.URLRequest;
- import flash.net.navigateToURL;
-
- public class GameChina
- {
-
-
- private var PARENT:MovieClip;
-
- private var mc:MovieClip;
-
- public function GameChina(param1:MovieClip)
- {
- super();
- trace("GameChina");
- PARENT = param1;
- initMc();
- initEvent();
- }
-
- private function clickMc(param1:MouseEvent) : void
- {
- navigateToURL(new URLRequest("http://www.game.com.cn/"),"_blank");
- }
-
- private function initMc() : void
- {
- mc = new _ChinaGame_();
- trace(mc);
- PARENT.addChild(mc);
- mc.x = 320;
- mc.y = 240;
- }
-
- private function delMc() : void
- {
- PARENT.removeChild(mc);
- }
-
- private function initEvent() : void
- {
- mc.addEventListener(MouseEvent.CLICK,clickMc);
- mc.addEventListener(Event.ENTER_FRAME,enterFrameMc);
- }
-
- public function del() : void
- {
- delEvent();
- delMc();
- }
-
- private function enterFrameMc(param1:Event) : void
- {
- if(mc.totalFrames == mc.currentFrame)
- {
- trace("showGameStart");
- PARENT.dispatchEvent(new Event("showGameStart",true));
- }
- }
-
- private function delEvent() : void
- {
- mc.removeEventListener(Event.ENTER_FRAME,enterFrameMc);
- mc.removeEventListener(MouseEvent.CLICK,clickMc);
- }
- }
- }
-