开发者

Manipulate drawn vectors using AS3

What I want to do is draw a shape using the pen tool and then manipulate this shape using AS3 to distort 开发者_如何学运维the anchor points. How can I access the anchor points etc from within AS3? I can convert the drawn shape to a movie clip symbol, and access this from the Action Script, but how do I then manipulate the vector?

Thanks


Unfortunately, you can't do it like that. A shape drawn in the IDE will not be editable once you export the swf.

If you want to create an animated element, you can draw with ActionScript, using the Graphics API, but you need to create your shape programmatically, and redraw the image every time an anchor changes.

If you actually want users to be able to draw in real time, there is no quick and easy way to do this, either: You need to create your own pen tool and anchors, draw lines between them, make them draggable, implement undo, etc.

Here are some "first steps" tutorials on how to do something like that in AS2 and AS3.


You might try programatically drawing your shape, and then redraw it with new point information at an interval suitable for your animation, with either an ENTER_FRAME event or a timer.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜