0
我有一小段代码可以从朋友处获得,但是我无法将其转化为工作的AS3.0。无论我改变什么,我总是收到编译器错误。 这是最初的一段代码,我真的很感谢你看看它。将脚本代码从Actionscript 2转换为Actionscript 3
laser_nodes = 2;
for (var x=1; x<=laser_nodes; x++) {
node = _root.attachMovie("laser", "laser_"+x, x, {_x:Math.random()*460+20, _y:Math.random()*310+20});
node.onPress = function() {
startDrag(this);
};
node.onRelease = function() {
stopDrag();
};
}
_root.createEmptyMovieClip("ray", _root.getNextHighestDepth());
ray.onEnterFrame = function() {
this.clear();
this.lineStyle(3, 0xff0000);
this.moveTo(_root.laser_1._x, _root.laser_1._y);
for (x=2; x<=laser_nodes; x++) {
this.lineTo(_root["laser_"+x]._x, _root["laser_"+x]._y);
}
this.lineTo(_root.laser_1._x, _root.laser_1._y);
};
如果您发布了特定的编译器错误,它会有所帮助。 – sean
如果您发布迄今为止创建的ActionScript 3代码,它也会有所帮助。 –