yoguz
查看yoguz的博客
金钱 | : 18255 |
Level | : 0 |
发帖数 | : 1564 |
最后登陆 | : 2019/10/24 |
注册时间 | : 2004/12/13 |
|
/* Created by Xiangming xm2002mx@sohu.com */ client_nc = new NetConnection(); client_nc.onStatus = function(info) { trace("Level: "+info.level+newline+"Code: "+info.code); }; client_nc.connect("rtmp:/doodle"); doodle_so = SharedObject.getRemote("doodle", client_nc.uri, true); doodle_so.onSync = function() { if (this.data.pressed) { createEmptyMovieClip("line_so"+idx, idx+1000); with ("line_so"+idx) { lineStyle(1, 0x000000, 100); moveTo(this.data.x, this.data.y); } this.data.pressed = false; } with ("line_so"+idx) { lineTo(this.data.x, this.data.y); } }; doodle_so.connect(client_nc); var drawObj = new Object(); var idx = 1; var pressed = false; drawObj.onMouseDown = function() { pressed = true; doodle_so.data.pressed = true; createEmptyMovieClip("line"+idx, idx); with ("line"+idx) { lineStyle(1, 0x000000, 100); moveTo(_xmouse, _ymouse); } }; drawObj.onMouseMove = function() { if (pressed) { doodle_so.data.x = _xmouse; doodle_so.data.y = _ymouse; with ("line"+idx) { lineTo(_xmouse, _ymouse); } } }; drawObj.onMouseUp = function() { pressed = false; idx++; }; Mouse.addListener(drawObj); 源文件下载 http://www2.flash8.net/UploadTeach/2005/10/25/20051025152757861.rar 测试时别忘了在C:\Program Files\Macromedia\Flash Media Server 2\applications或相关目录创建一个名为doodle的空文件夹,然后多次双击doodle.swf打开多个窗口 ;) 再在每个窗口中涂涂看。
|