Changeset 14845 for lang/actionscript
- Timestamp:
- 06/29/08 18:48:10 (5 years ago)
- Location:
- lang/actionscript/todoshare
- Files:
-
- 3 modified
-
.actionScriptProperties (modified) (1 diff)
-
DBConsole.html (modified) (3 diffs)
-
TodoShare.as (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/actionscript/todoshare/.actionScriptProperties
r14797 r14845 19 19 </excludedEntries> 20 20 </libraryPathEntry> 21 <libraryPathEntry kind="3" linkType="1" path="corelib.swc" useDefaultLinkType="false"/> 21 22 </libraryPath> 22 23 <sourceAttachmentPath/> -
lang/actionscript/todoshare/DBConsole.html
r14800 r14845 4 4 <script src="jsql.js"></script> 5 5 <script> 6 6 /* 7 7 doQuery(["GET",{ 8 8 from: "relation", … … 12 12 alert(Object.toJSON(e)); 13 13 14 }); 14 });*/ 15 15 16 16 function ins() { … … 27 27 } ); 28 28 } 29 </script> 29 function exe() { 30 $("TodoShare").addTodo($("cmd").value); 31 } 32 </script><!-- 30 33 Object <input id=inp_obj type=text name=obj><BR> 31 34 Name <input id=inp_name type=text name=name><BR> 32 35 Value <input id=inp_val type=text name=val><BR> 33 <button onClick="ins()">INS</button> 36 <button onClick="ins()">INS</button--> 37 <input id=cmd type=text length=80 onenter="exe()"> 38 <button onClick="exe()">Exe</button> 39 <BR> 34 40 41 <embed id="TodoShare" width="400" height="300" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" allowscriptaccess="sameDomain" name="TodoShare" bgcolor="#ffffff" quality="high" src="bin-debug/TodoShare.swf"/> 35 42 43 36 44 </body> 37 45 </html> -
lang/actionscript/todoshare/TodoShare.as
r14797 r14845 4 4 import flash.display.Sprite; 5 5 import flash.events.Event; 6 import flash.external.ExternalInterface; 6 7 import flash.geom.Rectangle; 8 import flash.net.URLLoader; 9 import flash.net.URLRequest; 10 import flash.net.URLRequestMethod; 11 import flash.net.URLVariables; 12 13 import util.Debug; 7 14 [SWF(width="800",height="600",frameRate="24",backgroundColor="#FFFFFF")] 8 15 … … 11 18 var canvas:Bitmap; 12 19 var canvasData:BitmapData; 13 var cx:int,cy:int,w:int,h:int;14 var clWhite:uint=color(255,255,255);15 var clBlack:uint=color(0,0,0);20 public var cx:int,cy:int,w:int,h:int; 21 public static var clWhite:uint=color(255,255,255); 22 public static var clBlack:uint=color(0,0,0); 16 23 var inited:Boolean=false; 24 public static var root:TodoShare ; 17 25 public function TodoShare() 18 26 { 27 TodoShare.root=this; 19 28 addEventListener(Event.ENTER_FRAME,onTimer); 20 29 } … … 34 43 //fillRect(10,20,300,400,clWhite); 35 44 fillRect(0,cy,w,1,clBlack); 36 fillRect(cx,0, 1,h,clBlack);45 fillRect(cx,0,5,h,clBlack); 37 46 inited=true; 47 //send(); 48 49 ExternalInterface.addCallback( 50 "addTodo", addTodo 51 ); 52 53 ExternalInterface.addCallback( 54 "getDebug", function () { 55 return Debug.getClear(); 56 } 57 ); 58 //throw new Error(JSON.decode('{"a":"3", "b":"5"}')); 59 } 60 public function addTodo(s:String) { 61 addChild(new Todo(s,Math.random()*1-0.5,Math.random()*1-0.5)); 38 62 } 39 63 public function fillRect(x:int,y:int,w:int,h:int,col:uint):void { … … 43 67 return ((t*256+r)*256+g)*256+b; 44 68 } 45 } 69 public function send():void { 70 //var params:URLVariables = new URLVariables("cmd=" + "{a:3, b:5, c:0}"); 71 //params.decode("cmd=" + "{a:3, b:5, c:0}"); 72 var variables:URLVariables = new URLVariables(); 73 variables.cmd='{"a":"3", "b":"5", "c":"0"}'; 74 //throw new Error(variables+""); 75 var request:URLRequest = new URLRequest("http://192.168.28.128/workspace/TodoShare/test.cgi"); 76 request.method = URLRequestMethod.POST; 77 request.data = variables; //params; 78 var urlLoader:URLLoader = new URLLoader(); 79 //urlLoader.dataFormat = URLLoaderDataFormat.VARIABLES; 80 urlLoader.load(request); 81 urlLoader.addEventListener(Event.COMPLETE, onPostComplete); // post完了イベントに関数登録 82 } 83 public function onPostComplete(e:Event):void { 84 //throw new Error("OK"); 85 //var params:URLVariables = new URLVariables(e.target.data); 86 throw new Error("received: " + e.target.data);//+" / "+params);//+"/"+ unescape(params.toString())); 87 } 88 } 46 89 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)