新建一flash文档,把下面的代码放在第一帧,测试影片你就会看到一个漂亮的圆形。
var clip:MovieClip = this.createEmptyMovieClip("circle_mc",
this.getNextHighestDepth( ));
circle_mc._x = circle_mc._y = 150;
circle_mc.lineStyle(200, 0x0, 100);
circle_mc.moveTo(0, 0);
circle_mc.lineTo(0.2, 0);
新建一flash文档,把下面的代码放在第一帧,测试影片看看更有趣的效果。
function createPoint(dynaPoint, depth, x, y) {
clip = this.createEmptyMovieClip(dynaPoint, depth);
clip.lineStyle(20, 0x0, 100);
clip.moveTo(0, 0);
clip.lineTo(0.2, 0);
clip._x = x;
clip._y = y;
}
function drag( ) {
this.startDrag(true);
paper.onMouseMove = drawLine;
this.onPress = drop;
}
function drop( ) {
this.stopDrag( );
delete (paper.onMouseMove);
this.onPress = drag;
}
function drawLine( ) {
this.clear( );
this.lineStyle(2, 0x0, 100);
this.moveTo(point1._x, point1._y);
this.lineTo(point2._x, point2._y);
updateAfterEvent( );
}
// Example usage:
createPoint("point1", 1, 100, 100);
createPoint("point2", 2, 120, 100);
point1.onPress = drag;
point2.onPress = drag;
this.createEmptyMovieClip("paper", 0);