1. Create Slave.as:
   package {
     import flash.display.MovieClip;
     public class Slave extends MovieClip{}
   }
   2. mxmlc -output=slave.swf Slave.as
   3. Create master.sc:
   .flash bbox=200x200 version=9 fps=15 name="master.swf"
   .action:
    package
   {
   public dynamic class Master extends flash.display.MovieClip
    {
   public function Master()
   {
   new Slave();
    }
   }
   }
   .end
   .swf slave "slave.swf"
    .put slave
   .end
   4. swfc master.sc
   5. Run master.swf in Flash Player.

Now Flash Player raise a error:
Error: Error #2136: SWF 文件
file:///C|/cygwin/home/atry/Documents/swfc%5Fwrong%5Fcharacter%5Fid/master.swf
包含无效数据。
at Master()

This error is because swfc assign an nonexistent charecter ID for
slave.swf's document class Slave. This problem can be located by swfdump
master.swf:

[HEADER]        File version: 9
[HEADER]        File is zlib compressed. Ratio: 57%
[HEADER]        File size: 1213
[HEADER]        Frame rate: 15.000000
[HEADER]        Frame count: 1
[HEADER]        Movie width: 200.00
[HEADER]        Movie height: 200.00
[045]         4 FILEATTRIBUTES usenetwork as3 symbolclass
[009]         3 SETBACKGROUNDCOLOR (00/00/00)
[052]       301 DOABC
[04c]        11 SYMBOLCLASS
                exports 0000 as "Master"
[04d]       456 METADATA
[041]         4 SCRIPTLIMITS
[029]        26 SERIALNUMBER
[04c]        10 SYMBOLCLASS
                *exports 0002 as "Slave"* # Should be 0001 here
[027]         4 DEFINESPRITE defines id 0001
[02b]         6          FRAMELABEL "Slave"
[052]       287          DOABC "frame1", lazy load
[001]         0          SHOWFRAME 1 (00:00:00,000) (label "Slave")
[000]         0          END
[028]         8 NAMECHARACTER adds information to id 0001 "slave"
[038]        10 EXPORTASSETS
                exports 0001 as "slave"
[01a]        11 PLACEOBJECT2 places id 0001 at depth 0001 name "slave"
[001]         0 SHOWFRAME 1 (00:00:00,000)
[000]         0 END

The version I use is swftools 2012-10-15-1307
---------------
SWFTools-common is a self-managed list. To subscribe/unsubscribe, or amend an 
existing subscription, please kindly point your favourite web browser 
at:<http://lists.nongnu.org/mailman/listinfo/swftools-common>

Reply via email to