|
From: Klaus R. <kla...@rz...> - 2007-09-25 15:47:49
|
Hi Zou,
i think i found a clean way to implement such a feature for ming. Attached is
a preliminary patch.
I introduced a new method on a SWFDisplayItem object called
SWFDisplayItem_flush(item). This method does basicly the same thing as the
SWFMovie_nextFrame() call but also clears all flags of the item and prevents
a second place/remove when calling nextFrame() (in theory at least ;)).
This example code should produce the pattern you need:
int main()
{
SWFAction action1 = newSWFAction("trace(1);");
SWFAction action2 = newSWFAction("trace(2);");
SWFAction action3 = newSWFAction("trace(3);");
SWFMovie m = newSWFMovie();
SWFShape s1 = newSWFShape();
SWFShape s2 = newSWFShape();
SWFDisplayItem shapeItem1;
SWFDisplayItem shapeItem2;
shapeItem1 = SWFMovie_add(m, s1);
SWFDisplayItem_flush(shapeItem1);
SWFMovie_add(m, action1);
shapeItem2 = SWFMovie_add(m, s2);
SWFDisplayItem_flush(shapeItem2);
SWFMovie_add(m, action2);
SWFDisplayItem_remove(shapeItem1);
SWFDisplayItem_flush(shapeItem1);
SWFMovie_add(m, action3);
SWFDisplayItem_remove(shapeItem2);
SWFDisplayItem_flush(shapeItem2);
SWFMovie_save(m, "flush.swf");
return 0;
}
Happy Ming-Hacking :)
Klaus
On Tuesday 25 September 2007 07:30:55 zou lunkai wrote:
> Hi Klaus,
>
> In Gnash's testsuite, many of the testcases are based on Ming. Tags
> order control in the source level would be a interesting feature. As
> we found, tags order affects the overall actions execution order of
> the SWF file. Basically, we'd like to do something like this(within or
> without the same frame):
>
> PLACE_OBJECT
> DO_ACTION
> PLACE_OBJECT
> DO_ACTION
> REMOVE_OBJECT
> DO_ACTION
> REMOVE_OBJECT
> ...
>
> But Ming(beta4) seems always group the above tags(no matter how you
> organize the source code) as follows:
> DO_ACTION
> DO_ACTION
> PLACE_OBJECT
> PLACE_OBJECT
> REMOVE_OBJECT
> REMOVE_OBJECT
> ....
>
> Although swfc could handle the above case perfectly as we need, but it
> also lacks of some other features that Ming does well. So we have to
> switch between them frequently. And that's really inconvenient.
>
> --zou
|