powered by nequal
Home » IO_SWF » Timeline » 2877

Changeset 2877 -- 2012-02-20 23:07:34

Author
よや
Comment
Delete ActionTag in DefineSprite.

Diffs

IO_SWF/trunk/sample/swfdeleteaction.php

@@ -16,11 +16,26 @@
$swf->parse($swfdata);
-foreach ($swf->_tags as $idx => $tag) {
+foreach ($swf->_tags as $idx => &$tag) {
$tag_code = $tag->code;
if (($tag_code == 12) || ($tag_code == 59)) { // DoAction, DoInitAction
unset($swf->_tags[$idx]);
}
+    if ($tag_code == 39) { // DefineSprite
+        if ($tag->parseTagContent() === false) {
+            echo "Unknown DefineSprite!!!\n";
+            exit(1);
+        }
+        foreach ($tag->tag->_controlTags as $idx_in_sprite => &$tag_in_sprite) {
+            $tag_code_in_sprite = $tag_in_sprite->code;
+            // DoAction, DoInitAction
+            if (($tag_code_in_sprite == 12) || ($tag_code_in_sprite == 59)) {
+                unset($tag->tag->_controlTags->_tags[$idx_in_sprite]);
+                $tag_in_sprite->content = null;
+                $tag->content = null;
+            }
+        }
+    }
}
echo $swf->build();