Is there a format specification for XML files from FLA import in CS5?

1.4k views Asked by At

CS5 allows you to save FLA project as a bunch of XML files that encode vector graphics in some format, like:

<Edge cubics="!8809 4331(;8821,4327 8849,4316 8865,4311q8809 4331 8865 4311);" /> 

Is there a format specification somewhere explaining what those entries mean?

2

There are 2 answers

0
fenomas On BEST ANSWER

Not yet. Adobe has said they intend to release a spec, but it doesn't seem to have happened yet.

Unfortunately I also don't think it's currently known what those numbers mean (unless you figure it out!). But I can make an educated guess that the numbers themselves are probably in twips (which in Flash-speak are twentieths of a pixel, not of a point as in typography), so if you divide them all by twenty you'll probably have pixel offsets measured from the upper-left corner of... something. ;) Which may be enough for you to decipher what that line means.

But right now, the best we can do is interpret a given piece of XFL; there's no way to completely know in what way it is or isn't legal to change it.

0
Oldes On

I don't know exact meaning yet, but it looks that this is additional info for the Flash API about the shape. This info is not needed and you can delete this lines and still load the XFL without problems. The cubics data will be added again when you try to edit the shape again. It's just something like a cache info.

You can see it here:

<Edge fillStyle1="1" strokeStyle="1" edges="!2720 2720|0 2720!0 2720|0 0!0 0/2720 2720"/>
<Edge cubics="!0 2720(;0,2720 0,0 0,0q0 2720 0 0);"/>
<Edge cubics="!2720 2720(;2720,2720 0,2720 0,2720q2720 2720 0 2720);"/>
<Edge cubics="!0 0(;0,0 2720,2720 2720,2720q0 0 2720 2720);"/>

This is triangle consisting with 3 lines and the related additional cubics info.

Also note that the edges data is unnecessarily verbose. The same shape could be described like:

    ChangeStyle:
        Move: [2720 2720]
        FillStyle1: 1
        LineStyle: 1
    Line: -2720 0 0 -2720 2720 2720 

This one is for two lines, one horizontal and one vertical:

<Edge strokeStyle="1" edges="!2640 3020|2640 5240!1520 1740|4879 1740"/>
<Edge cubics="!1520 1740(;1520,1740 4879,1740 4879,1740q1520 1740 4879 1740);"/>

The data does not change with each shape change so it must be just some internal helpful stuff. I recommend to remove these lines if you want to build/modify the shape data with some external tool (as I want to do).

Fenomas is right that the numbers are in twips so if you want pixel values, you must divide them by 20.