我是 Flash 编程的新手。我对 Flash/SWF 中的标签如何工作没有太多了解。这可能是我失败的原因。请您如何检查此代码并告诉我我在哪里犯了错误?
Swf swf = new Swf();
DefineTextTag dtt = new DefineTextTag();
TextRecord tr = new TextRecord();
MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes("Hello"));
SwfDotNet.IO.Utils.BufferedBinaryReader reader = new SwfDotNet.IO.Utils.BufferedBinaryReader(ms);
bool flag = true;
tr.ReadData(reader, ref flag, TagCodeEnum.DefineText2);
tr.TextColor = RGBColor.FromWinColor(Color.Black);
tr.XOffset = 10;
tr.YOffset = 10;
dtt.TextRecords.Add(tr);
dtt.Add("Hello World");
dtt.UpdateData(1);
swf.Tags.Add(dtt);
swf.Tags.Add(new ShowFrameTag());
SwfWriter writer = new SwfWriter("Quiz 1.swf");
writer.Write(swf);
writer.Close();