0

i need polygon information to do my map path finding .now the map designer can draw the unreachable area in the Flash professional,but how to get the shapes info bugs me.

i found the answer here How do you get Polygons from MovieClips in Flash?

so basically it's a dead end.

i got to solve the problem in other ways.

how about present the area while saving it in an data format like this example:

<area>
    <point>3,40</point>
    <point>30,120</point>
    <point>40,150</point>
    <point>4,120</point>
<area>
....

every polygon's point is linked by line ,no curves.

i can build a tool,which allow designers to add/remove/move polygon, add/delete/move the vertices on the polygon.

if there's already a tool there, i don't have to do it by myself,please tell me if you know it.

Community
  • 1
  • 1
user2003548
  • 4,287
  • 5
  • 24
  • 32
  • do you want to do this on the fly? e.g. load the SWF with maps containing shapes and read it, or you want to help the designer and it will be prepared (the xml) before and loaded into SWF? If latter then you could look at the JSFL option, as it can give you more details about shapes on stage/movieclip so the workflow could be: designer creates map, then runs JSFL which creates the XML – Lukasz 'Severiaan' Grela Mar 19 '13 at 08:52
  • ok,i will check your advise on JSFL. – user2003548 Mar 19 '13 at 09:32
  • go for it if it is a part of preprocessing (not dynamic on-the-fly solution) if it is on-the-fly use option proposed by the Vesper below – Lukasz 'Severiaan' Grela Mar 19 '13 at 11:41

1 Answers1

0

If your polygons are of type Shape, or are using this.graphics at design time or run time, you can receive some of the data via graphics.ReadGraphicsData() Here is the manual. Perhaps you will be able to retrieve the desired info from there, as that IGraphicsData contains shape graphics commands including moveTo(), lineTo(), curveTo() with corresponding coordinate sets. These will net you polygon vertices, once you parse the composite output. (But, this task might be complicated, it's untreaded ground for me. I only give a hint here)

Vesper
  • 18,599
  • 6
  • 39
  • 61
  • 1
    :) I just meant to add this [post](http://stackoverflow.com/questions/15482618/find-all-points-along-a-path-as3) which pointed to the [Graphics.readGraphicsData](http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/Graphics.html#readGraphicsData%28%29) – Lukasz 'Severiaan' Grela Mar 19 '13 at 09:05