-
Notifications
You must be signed in to change notification settings - Fork 0
/
BattleWin.as
76 lines (54 loc) · 1.45 KB
/
BattleWin.as
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package
{
import flash.events.Event;
/**
* ...
* @author ShrekShao
*/
public class BattleWin extends State
{
protected var btf:Battlefield;
public function BattleWin(m:MenuManager)
{
super(m);
}
override public function Execute():void
{
}
override public function Enter():void
{
btf = new Battlefield();
btf.addEventListener("ReturnToMain", ReturnToMain);
btf.addEventListener("CancelToMain", CancelToMain);
//stage.addChild(btf);
mm.AddChildToMain(btf,-1);
btf.NewBattle();
}
override public function Exit():void
{
//stage.removeChild(btf);
}
public function CancelToMain(e:Event):void
{
btf.dispatchEvent(new Event("open_play", true));
mm.ChangeState(new MainWin(mm));
btf.dispatchEvent(new Event("back_adjust", true));
btf.dispatchEvent(new Event(Main.event_play_bgm, true));
mm.RemoveChildFromMain(btf);
}
public function ReturnToMain(e:Event):void
{
btf.dispatchEvent(new Event("start_play", true));
btf.stage.addEventListener("close_stop", BackToMain);
}
public function BackToMain(e:Event):void
{
btf.stage.removeEventListener("close_stop", BackToMain);
btf.dispatchEvent(new Event("open_play", true));
mm.ChangeState(new MainWin(mm));
btf.dispatchEvent(new Event("back_adjust", true));
btf.dispatchEvent(new Event(Main.event_play_bgm, true));
mm.RemoveChildFromMain(btf);
}
}
}