[Swfed-svn] swfed-svn [394] replaceMovieClip のテストスクリプト

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2011年 3月 8日 (火) 02:20:14 JST


Revision: 394
          http://sourceforge.jp/projects/swfed/svn/view?view=rev&revision=394
Author:   yoya
Date:     2011-03-08 02:20:14 +0900 (Tue, 08 Mar 2011)

Log Message:
-----------
replaceMovieClip のテストスクリプト

Added Paths:
-----------
    trunk/sample/swfreplacemovieclip.php


-------------- next part --------------
Added: trunk/sample/swfreplacemovieclip.php
===================================================================
--- trunk/sample/swfreplacemovieclip.php	                        (rev 0)
+++ trunk/sample/swfreplacemovieclip.php	2011-03-07 17:20:14 UTC (rev 394)
@@ -0,0 +1,30 @@
+<?php
+
+if (($argc < 4) || ($argc%2 != 0)) {
+	fprintf(STDERR, "Usage: swfreplacemovieclip <swf_file> <instance_name> <movieclip_swffile> [<instance_name2> <movieclip_swffile2> [...]]\n");
+	exit(1);
+}
+
+$swf_filename = $argv[1];
+
+$swfdata = file_get_contents($swf_filename);
+$obj = new SWFEditor();
+
+if ($obj->input($swfdata) == false) {
+	fprintf(STDERR, "input failed\n");
+	exit(1);
+}
+
+for ($i=2 ; $i < $argc ; $i+=2) {
+	$instance_name = $argv[$i];
+	$movieclip_swffilename = $argv[$i+1];
+	$movieclip_swfdata = file_get_contents($movieclip_swffilename);
+	if ($obj->replaceMovieClip($instance_name, $movieclip_swfdata) == false) {
+		fprintf(STDERR, "replaceMovieClip($instance_name, ...) failed\n");
+		exit(1);
+	}
+}
+
+echo $obj->output();
+
+$obj->_destroy_and_exit();



Swfed-svn メーリングリストの案内
Back to archive index