|
1: <?xml version="1.0" encoding="utf-8"?>
2: <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="300" height="200">
3: <mx:Script>
4: <![CDATA[
5: public var stickies:Array = new Array();
6: public function create():void {
7: var sticky:Sticky = new Sticky();
8: sticky.show();
9: stickies.push(sticky);
10: messages.text += ">> Created new sticky\n"; // ディバグ用
11: }
12: public function load():void { // 追加
13: var request:URLRequest = new URLRequest("http://localhost:3000/stickies.xml");
14: request.method = 'GET';
15: var loader:URLLoader = new URLLoader();
16: loader.addEventListener(Event.COMPLETE, function(e:Event):void {
17: messages.text += e.target.data + "\n";
18: });
19: loader.load(request);
20: }
21: ]]>
22: </mx:Script>
23: <mx:Button left="10" top="10" label="新規" id="new_btn" click="create();" />
24: <mx:Button right="60" top="10" label="読み込み" id="load_btn" click="load();" /> <!-- 変更 -->
25: <mx:Button right="10" top="10" label="保存" id="save_btn" click="save();"/> <!-- 変更 -->
26: <mx:TextArea right="10" top="40" left="10" bottom="10" id="messages" />
27: </mx:WindowedApplication>
|
|