powered by nequal
Home » IO_SWF » Timeline » 2537

Changeset 2537 -- 2011-07-04 17:51:04

Author
よや
Comment
setActionVariables メソッドのテストスクリプト (複数同時書き換えも対応予定)

Diffs

IO_SWF/trunk/sample/swfsetactionvariables.php

@@ -0,0 +1,28 @@
+<?php
+
+require 'IO/SWF/Editor.php';
+// require dirname(__FILE__).'/../IO/SWF/Editor.php';
+
+if ($argc != 4) {
+    fprintf(STDERR, "Usage: php swfsetactiovaribles.phpp <swf_file> <from_str> <to_str>\n");
+    fprintf(STDERR, "ex) php swfactionvariables.php test.swf foo baa\n");
+    exit(1);
+}
+
+assert(is_readable($argv[1]));
+assert(isset($argv[2]));
+assert(isset($argv[3]));
+
+$swfdata = file_get_contents($argv[1]);
+$from_str = $argv[2];
+$to_str = $argv[3];
+
+$swf = new IO_SWF_Editor();
+
+$swf->parse($swfdata);
+
+$swf->setActionVariables($from_str, $to_str);
+
+echo $swf->build();
+
+exit(0);