Rendering 3D objects in Flash

Step 2

Converting the .ASC file to an actionscript compatible code

    The .asc file has a
    "Vertex 38: X: 3.1 Y:-20.0 Z:-33.8"
    format, for the vertices. We do want to convert this to a x,y,z format,in order to parse it into the function we will build afterwards.
    Also, the faces definition is like
    "Face 5: A:2 B:3 C:16 AB:1 BC:1 CA:0"
    This means that A stands for vertex number 2, as previously defined, B for vertex 3, c for vertex 16. If AB equals 1, then vertex A should be connected with vertex B with a line,and so on for BC.
    In this implementation you can watch that there are some connections mentioned twice, eg, you may see vertex 12 connected with vertex 36, and afterwards in an other face, vertex 36 connected again with vertex 12. Do not worry about that; The macro that we will execute afterwards will remove this duplicate vertex connections.
  1. Download the document asc2flash.doc, and open it. You must have set properly the security options so that the macros in this document can be allowed to execute.
  2. Either copy the contents of the .asc file into the blank document, or insert them using the menu command "Insert/File..."
  3. Execute the macro asc2actionscript
  4. Keep the result for further use

Back to start                Go to step 3