Changeset 14845 for lang/actionscript

Show
Ignore:
Timestamp:
06/29/08 18:48:10 (5 years ago)
Author:
hoge1e3
Message:
 
Location:
lang/actionscript/todoshare
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • lang/actionscript/todoshare/.actionScriptProperties

    r14797 r14845  
    1919</excludedEntries> 
    2020</libraryPathEntry> 
     21<libraryPathEntry kind="3" linkType="1" path="corelib.swc" useDefaultLinkType="false"/> 
    2122</libraryPath> 
    2223<sourceAttachmentPath/> 
  • lang/actionscript/todoshare/DBConsole.html

    r14800 r14845  
    44  <script src="jsql.js"></script> 
    55<script> 
    6  
     6/* 
    77doQuery(["GET",{ 
    88    from: "relation", 
     
    1212  alert(Object.toJSON(e)); 
    1313   
    14 });  
     14});*/  
    1515 
    1616function ins() { 
     
    2727   } ); 
    2828} 
    29 </script> 
     29function exe() { 
     30   $("TodoShare").addTodo($("cmd").value); 
     31} 
     32</script><!-- 
    3033Object <input id=inp_obj type=text name=obj><BR> 
    3134Name <input  id=inp_name type=text name=name><BR> 
    3235Value <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> 
    3440 
     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"/> 
    3542 
     43    
    3644  </body> 
    3745</html> 
  • lang/actionscript/todoshare/TodoShare.as

    r14797 r14845  
    44        import flash.display.Sprite; 
    55        import flash.events.Event; 
     6        import flash.external.ExternalInterface; 
    67        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; 
    714        [SWF(width="800",height="600",frameRate="24",backgroundColor="#FFFFFF")] 
    815     
     
    1118                var canvas:Bitmap; 
    1219                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); 
    1623                var inited:Boolean=false; 
     24                public  static var root:TodoShare ; 
    1725                public function TodoShare() 
    1826                { 
     27                        TodoShare.root=this; 
    1928                        addEventListener(Event.ENTER_FRAME,onTimer); 
    2029                } 
     
    3443                        //fillRect(10,20,300,400,clWhite); 
    3544                        fillRect(0,cy,w,1,clBlack); 
    36                         fillRect(cx,0,1,h,clBlack); 
     45                        fillRect(cx,0,5,h,clBlack); 
    3746                        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)); 
    3862                } 
    3963                public function fillRect(x:int,y:int,w:int,h:int,col:uint):void { 
     
    4367                        return ((t*256+r)*256+g)*256+b; 
    4468                } 
    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 } 
    4689}