源码下载:flash_copy.rar
主要代码:
//定义公共函数。。。 class ClipBoard extends Object { static var $contents:Object; static var $operation:String; function ClipBoard() { } //定义当选择剪切时的效果。。。 public static function cut(obj) { obj._alpha = 50; $contents = obj; $operation = "cut"; } //定义复制函数。。。 public static function copy(obj) { $contents = obj; $operation = "copy"; } //定义删除函数。。。 public static function remove(obj) { $contents = obj; $operation = "remove"; $contents.removeMovieClip(); } //定义顺时针旋转。。。 public static function rotation(obj) { $contents = obj; $operation = "rotation"; $contents._rotation += 45; } //定义逆时针旋转。。。 public static function rotation2(obj) { $contents = obj; $operation = "rotation2"; $contents._rotation -= 45; } //定义移动。。。 private static var xm:Number; private static var ym:Number; public static function movethis(obj) { $contents = obj; $operation = "movethis"; _root.onMouseDown = function() { xm = _xmouse; ym = _ymouse; movethisit(); }; function movethisit() { _root.onEnterFrame = function() { $contents._x += (xm-$contents._x)/5; $contents._y += (ym-$contents._y)/5; if (Math.abs($contents._x-xm)<0.5) { _root.onEnterFrame = undefined; } }; } } //定义刷新。。。 public static function refish() { getURL("javascript:location.reload()"); } //定义粘贴功能。。。 public static function paste() { if ($operation == "cut") { $contents._x = _root._xmouse; $contents._y = _root._ymouse; $contents._alpha = 100; $contents = undefined; $operation = ""; } else if ($operation == "copy") { var newdepth = $contents._parent.getNextHighestDepth(); var newname = $contents._name+newdepth; $contents.duplicateMovieClip(newname, newdepth); $contents._parent[newname]._x = _root._xmouse; $contents._parent[newname]._y = _root._ymouse; $contents._alpha = 100; $contents._parent[newname]._alpha = 100; } else if ($operation == "remove") { var newdepth = $contents._parent.getNextHighestDepth() |