チェンジセット 1875
- コミット日時:
- 2008/11/20 03:43:42 (2 ヶ月前)
- ファイル:
-
- air/TLife/application.xml (更新) (1 diff)
- air/TLife/bin/TLife.swf (更新) (変更前)
- air/TLife/src/Main.mxml (更新) (3 diffs)
- air/TLife/src/uwi/bean/StatusGetter.as (更新) (1 diff)
- air/TLife/src/uwi/thread/MainThread.as (更新) (2 diffs)
- air/TLife/src/uwi/thread/TwitterLoginThread.as (更新) (4 diffs)
- air/TLife/src/uwi/thread/TwitterReloadThread.as (更新) (3 diffs)
- air/TLife/src/uwi/util/Components.as (更新) (2 diffs)
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
air/TLife/application.xml
r1873 r1875 13 13 <title>TLife</title> 14 14 <content>TLife.swf</content> 15 <systemChrome>standard</systemChrome> 16 <transparent>false</transparent> 15 <!-- <systemChrome>standard</systemChrome> --> 16 <!-- <transparent>false</transparent> --> 17 <systemChrome>none</systemChrome> 18 <transparent>true</transparent> 17 19 <visible>true</visible> 18 20 <minimizable>true</minimizable> 19 <maximizable> true</maximizable>21 <maximizable>false</maximizable> 20 22 <resizable>true</resizable> 21 23 </initialWindow> air/TLife/src/Main.mxml
r1874 r1875 1 1 <?xml version="1.0"?> 2 <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" applicationComplete="onLoad()"> 2 <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" 3 width="600" height="300" 4 layout="absolute" 5 applicationComplete="onLoad()"> 3 6 <mx:Script> 4 7 <![CDATA[ 5 8 import flash.display.Sprite; 6 9 import mx.collections.ArrayCollection; 10 import mx.controls.Alert; 11 import mx.events.FlexNativeMenuEvent; 12 import mx.events.MenuEvent; 7 13 import org.libspark.thread.EnterFrameThreadExecutor; 8 14 import org.libspark.thread.Thread; … … 12 18 13 19 [Bindable] 14 private var timeline : ArrayCollection = new ArrayCollection(); 20 private var tlrecent : ArrayCollection = new ArrayCollection(); 21 22 [Bindable] 23 private var tlreply : ArrayCollection = new ArrayCollection(); 15 24 16 25 private var c : Components = new Components(); 17 26 18 public function onLoad():void { 27 public function onLoad() : void 28 { 29 // stage.nativeWindow.width = 600; 30 // stage.nativeWindow.height = 300; 19 31 20 32 if(!Thread.isReady){ … … 24 36 Thread.uncaughtErrorHandler = function(e : Error, t : Thread) : void { trace(e.message); }; 25 37 26 c.foranalyzing = foranalyzing;27 38 c.forprinting = forprinting; 28 c.timeline = timeline; 39 c.tlrecent = tlrecent; 40 c.tlreply = tlreply; 29 41 30 42 new MainThread(this.stage, c).start(); 43 } 44 45 private function onMenuItemClick(event : MenuEvent) : void 46 { 47 Alert.show(event.label); 31 48 } 32 49 ]]> 33 50 </mx:Script> 34 51 35 <mx:DataGrid dataProvider="{timeline}" right="0" bottom="200" top="0" left="0"> 36 <mx:columns> 37 <!-- 38 <mx:DataGridColumn headerText="画像" dataField="image" width="40"> 39 <mx:itemRenderer> 40 <mx:Component><mx:Image width="32" height="32"/></mx:Component> 41 </mx:itemRenderer> 42 </mx:DataGridColumn> 43 --> 44 <mx:DataGridColumn headerText="username" dataField="voice" width="120"/> 45 <mx:DataGridColumn headerText="userid" dataField="voiceid" width="80"/> 46 <mx:DataGridColumn headerText="content" dataField="content" width="300" wordWrap="true"/> 47 <mx:DataGridColumn headerText="postedtime" dataField="postedtime" width="200" /> 48 </mx:columns> 49 </mx:DataGrid> 52 <mx:MenuBar dataProvider="{myMenuData}" 53 labelField="@label" 54 showRoot="false" 55 itemClick="onMenuItemClick(event);"> 56 </mx:MenuBar> 57 <mx:XML id="myMenuData"> 58 <xmlRoot> 59 <menuitem label="更新"> 60 <menuitem label="更新" /> 61 </menuitem> 62 <menuitem label="設定" /> 63 <menuitem label="へるぷ" /> 64 </xmlRoot> 65 </mx:XML> 50 66 51 <mx:Button label="reload" click="new TwitterReloadThread(c).start();" /> 52 <mx:DateFormatter id="foranalyzing" formatString="YYYY-MM-DDTJ:NN:SS" /> 67 <mx:TextArea x="0" y="20" width="100%" height="20" id="postarea" /> 68 69 <mx:TabNavigator x="0" y="40" width="100%" height="60%" 70 focusAlpha="0.6" 71 horizontalAlign="left" 72 > 73 <mx:VBox label="recent"> 74 <mx:DataGrid x="0" y="20" dataProvider="{tlrecent}"> 75 <mx:columns> 76 <!-- 77 <mx:DataGridColumn headerText="画像" dataField="image" width="40"> 78 <mx:itemRenderer> 79 <mx:Component><mx:Image width="32" height="32"/></mx:Component> 80 </mx:itemRenderer> 81 </mx:DataGridColumn> 82 --> 83 <mx:DataGridColumn headerText="username" dataField="voice" width="100"/> 84 <mx:DataGridColumn headerText="userid" dataField="voiceid" width="60"/> 85 <mx:DataGridColumn headerText="content" dataField="content" wordWrap="true"/> 86 <mx:DataGridColumn headerText="postedtime" dataField="postedtime" width="100" /> 87 </mx:columns> 88 </mx:DataGrid> 89 </mx:VBox> 90 91 <mx:VBox label="reply"> 92 <mx:DataGrid x="0" y="20" dataProvider="{tlreply}"> 93 <mx:columns> 94 <!-- 95 <mx:DataGridColumn headerText="画像" dataField="image" width="40"> 96 <mx:itemRenderer> 97 <mx:Component><mx:Image width="32" height="32"/></mx:Component> 98 </mx:itemRenderer> 99 </mx:DataGridColumn> 100 --> 101 <mx:DataGridColumn headerText="username" dataField="voice" width="100"/> 102 <mx:DataGridColumn headerText="userid" dataField="voiceid" width="60"/> 103 <mx:DataGridColumn headerText="content" dataField="content" wordWrap="true"/> 104 <mx:DataGridColumn headerText="postedtime" dataField="postedtime" width="100" /> 105 </mx:columns> 106 </mx:DataGrid> 107 </mx:VBox> 108 </mx:TabNavigator> 109 110 <!-- <mx:Button x="150" y="200" label="reload" click="new TwitterReloadThread(c).start();" /> --> 111 <!-- <mx:Button x="214" y="200" label="閉じる" click="onCloseButtonClick(event)"/> --> 112 53 113 <mx:DateFormatter id="forprinting" formatString="YY/MM/DD J:NN:SS" /> 54 114 air/TLife/src/uwi/bean/StatusGetter.as
r1874 r1875 13 13 var ret : Vector.<Status> = new Vector.<Status>(); 14 14 15 trace("src : " + src);16 17 15 var pinched : Vector.<String> = StringUtility.pinchAll(src, "<tr id=\"status_", "</tr>"); 18 trace("pinched : " + pinched.length);16 // trace("pinched : " + pinched.length); 19 17 for each(var str : String in pinched) { 20 18 ret.push(extract(str)); air/TLife/src/uwi/thread/MainThread.as
r1874 r1875 3 3 import flash.net.URLRequestDefaults; 4 4 import flash.text.TextField; 5 import flash.utils.getTimer; 5 6 import mx.collections.ArrayCollection; 7 import mx.core.Application; 6 8 import org.libspark.thread.Thread; 7 9 import org.libspark.thread.utils.SerialExecutor; … … 25 27 protected override function run() : void 26 28 { 27 // http://tinyurl.com/8wz28 29 //tuet = new TinyURLEncodeThread("http://www.google.co.jp"); 29 30 //tuet.start(); air/TLife/src/uwi/thread/TwitterLoginThread.as
r1874 r1875 4 4 import flash.net.URLRequestMethod; 5 5 import mx.controls.Alert; 6 import mx.core.Application; 6 7 import org.libspark.thread.Thread; 7 8 import org.libspark.thread.threads.net.URLLoaderThread; … … 22 23 protected override function run() : void 23 24 { 25 Application.application.statusBar.status = "Login.."; 24 26 var poststr : String = "session[username_or_email]=" + username + "&session[password]=" + password; 25 27 … … 38 40 private function onError(e : Error, t : Thread) : void 39 41 { 40 trace(e.getStackTrace());42 Alert.show(e.getStackTrace(), "Login"); 41 43 } 42 44 … … 45 47 if (event.status == 401) { 46 48 Alert.show("Login Failed!", "Login"); 47 trace("login failed!");48 49 } 50 Application.application.statusBar.status = "Login succeeded."; 49 51 } 50 52 } air/TLife/src/uwi/thread/TwitterReloadThread.as
r1874 r1875 2 2 import flash.net.URLRequest; 3 3 import mx.collections.ArrayCollection; 4 import mx.core.Application; 4 5 import org.libspark.thread.Thread; 5 6 import org.libspark.thread.threads.net.URLLoaderThread; … … 22 23 protected override function run() : void 23 24 { 25 Application.application.statusBar.status = "Reloading.."; 24 26 ult = new URLLoaderThread(new URLRequest("http://twitter.com/home")); 25 27 ult.start(); … … 30 32 private function loadCompleted() : void 31 33 { 34 Application.application.statusBar.status = "Reloaded."; 32 35 var statuses : Vector.<Status> = StatusGetter.get(ult.loader.data); 33 36 for each(var s : Status in statuses) { 34 components.t imeline.addItem( {37 components.tlrecent.addItem( { 35 38 voice : s.Voice, 36 39 voiceid : s.VoiceID, air/TLife/src/uwi/util/Components.as
r1874 r1875 1 1 package uwi.util { 2 import flash.utils.Dictionary; 2 3 import mx.collections.ArrayCollection; 3 4 import mx.formatters.DateFormatter; … … 8 9 */ 9 10 public class Components { 10 public var foranalyzing : DateFormatter;11 11 public var forprinting : DateFormatter; 12 12 13 public var timeline : ArrayCollection; 13 public var tlrecent : ArrayCollection; 14 public var tlreply : ArrayCollection; 15 16 public var statusdic : Dictionary; 14 17 } 15 18
