djcsdy / swfmill

Generate or decompile Adobe Flash SWF files using an XML dialect. Inspect and modify the XML by hand, or by using a built in XSLT processor.
http://www.swfmill.org/
GNU General Public License v2.0
131 stars 28 forks source link

Placing clips in simple dialect breaks if depth attribute is omitted #8

Open djcsdy opened 13 years ago

djcsdy commented 13 years ago

2009/8/19 Nick Sabalausky:

When placing clips in swfmill simple, is the depth attribute supposed to be required? If so, there should probably be an error or warning when it’s omitted (There doesn’t seem to be, currently). If not, then there’s a bug when doing so: If there’s multiple frames, all omitting the depth attribute, then only the first frame is ever actually shown.

In the sense that there's no code to choose a default for you, yes, it’s supposed to be required :). What actually happens is that swfmill generates <PlaceObject2 depth="" ... >, which I am guessing translates into depth="0" in the output SWF. That usually works, more by luck than judgement, but what doesn’t work is the code that kicks in if you’re replacing a previous object at the same depth.

Two possible solutions:

Three possible ways to choose a default:

Normally I’d prefer to choose a default but I think that, whatever default we choose, the resulting behaviour will be confusing once multiple frames come into play. An alternative would be to make depth mandatory if there are multiple frames, but optional otherwise.