dango_generator 0.4.8 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/templates/sample_as3mode/dango/client_swf/bin-debug/history/history.css +6 -0
- data/templates/sample_as3mode/dango/client_swf/bin-debug/history/history.js +662 -0
- data/templates/sample_as3mode/dango/client_swf/bin-debug/history/historyFrame.html +29 -0
- data/templates/sample_as3mode/dango/client_swf/bin-debug/sample_as3mode.swf +0 -0
- data/templates/sample_as3mode/dango/client_swf/src/sample_as3mode.mxml +11 -3
- data/templates/sample_servermode_chat/dango/client_swf/bin-debug/history/history.css +6 -0
- data/templates/sample_servermode_chat/dango/client_swf/bin-debug/history/history.js +662 -0
- data/templates/sample_servermode_chat/dango/client_swf/bin-debug/history/historyFrame.html +29 -0
- data/templates/sample_servermode_chat/dango/client_swf/bin-debug/sample_servermode_chat.swf +0 -0
- data/templates/sample_servermode_chat/dango/client_swf/src/sample_servermode_chat.mxml +15 -7
- metadata +9 -3
@@ -8,11 +8,11 @@
|
|
8
8
|
|
9
9
|
<mx:Script>
|
10
10
|
<![CDATA[
|
11
|
-
import org.rubyforge.dango.*;
|
12
|
-
import mx.utils.ObjectUtil;
|
11
|
+
import org.rubyforge.dango.*; // dangoライブラリを読み込み
|
13
12
|
|
14
13
|
private var dango_as3mode:DangoAS3Mode;
|
15
14
|
|
15
|
+
// コンストラクタの中で接続とイベントリスナの設定を行います
|
16
16
|
public function app_complete():void{
|
17
17
|
// Dangoの接続処理
|
18
18
|
try{
|
@@ -21,24 +21,32 @@
|
|
21
21
|
trace("接続エラー:failed to socket initialize.");
|
22
22
|
}
|
23
23
|
|
24
|
+
// dangoフレームワークでエラーが起きた場合のイベントリスナ定義
|
24
25
|
dango_as3mode.addEventListener("DangoError", connection_error);
|
26
|
+
|
27
|
+
// 接続完了時のイベントリスナ定義
|
25
28
|
dango_as3mode.addEventListener("dango__connect", dango__connect);
|
29
|
+
|
30
|
+
// 他のクライアントからデータを受け取った時のイベントリスナ定義
|
26
31
|
dango_as3mode.addEventListener("dango_as3mode_receive", dango_as3mode_receive);
|
27
32
|
}
|
28
33
|
|
29
|
-
//
|
34
|
+
// dangoフレームワークでエラーが起きた場合は接続エラーをtraceに出力
|
30
35
|
private function connection_error(evt:DangoErrorEvent):void {
|
31
36
|
trace("FrameworkError:code=" + evt.code + ":message=" + evt.message);
|
32
37
|
}
|
33
38
|
|
39
|
+
// 接続完了時に、テキストエリアに「接続完了」と表示します。
|
34
40
|
private function dango__connect(evt:DangoAS3ModeReceiveEvent):void{
|
35
41
|
log.text += "接続完了\n"
|
36
42
|
}
|
37
43
|
|
44
|
+
// メッセージを受け取った時に、テキストエリアに受け取ったメッセージを表示します。
|
38
45
|
private function dango_as3mode_receive(evt:DangoAS3ModeReceiveEvent):void{
|
39
46
|
log.text += evt.receive_data["chat"] + "\n"
|
40
47
|
}
|
41
48
|
|
49
|
+
// ボタンをクリックした時に全クライアントにchatメッセージを送信します
|
42
50
|
public function click():void{
|
43
51
|
dango_as3mode.send_object({"chat":input.text}, dango_as3mode.all_sid_list);
|
44
52
|
}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
|
2
|
+
|
3
|
+
#ie_historyFrame { width: 0px; height: 0px; display:none }
|
4
|
+
#firefox_anchorDiv { width: 0px; height: 0px; display:none }
|
5
|
+
#safari_formDiv { width: 0px; height: 0px; display:none }
|
6
|
+
#safari_rememberDiv { width: 0px; height: 0px; display:none }
|