private void ReadSymbolClass()
{
int numSymbols = this.sdtr.ReadUI16();
for (int i = 0; i < numSymbols; i++)
{
int cid = this.sdtr.ReadUI16();
string className = this.sdtr.ReadString();
#if DEBUG
this.Log("bind class '" + className + "' to character " + cid);
#endif
if (className.StartsWith("."))
{
/*
* ISSUE 41: I don't know why some files do this and some don't. An example of
* a file that does this is bottoms.swf in the flat avatar unit test. I
* really wish I could find where this came from so that I can see what's
* different in the .fla
*/
className = className.Substring(1);
}
if (cid == 0)
{
/* ID 0 is the main timeline */
this.LateClassResolutions.Add(className, this.swf);
continue;
}
if (!this.characterUnmarshaller.ContainsKey(cid))
{
throw new SWFModellerException(
SWFModellerError.SWFParsing,
"Can't bind class " + className + " to missing character ID " + cid, swf.Context);
}
ICharacter c = this.characterUnmarshaller[cid];
if (!(c is Timeline))
{
throw new SWFModellerException(
SWFModellerError.SWFParsing,
"Can't bind class " + className + " to non-timeline character " + c, swf.Context);
}
this.LateClassResolutions.Add(className, (Timeline)c);
}
}