Create editable shapes in Flex/Flash AS3?
I need to build a room designer, ultimately in Flex (Flash Builder 4). The part I am having trouble with is creating the room outline AND allowing the user to add/remove/move points to edit the room's shape. See this applic开发者_StackOverflowation for what I mean:
http://www.deltaportercable.com/shopdesigner/
I know how to create a normal Rect, but not one with editable points, much less how to add a point where the user clicks. Can anyone please point me in the right direction?
I think the key thing here is to try using POINTS instead RECTANGLES, then draw lines to connect these points to display any arbitrary shape that the user is editing.
Maybe use an array to record the initial positions of all four points, then based on the user input, update these points, and update your line drawing and how you connect them.
Start off by looking at Object Handles, which is a pretty good project for adding the edit points.
精彩评论