*
* @throws SWFParserException Thrown if parsing the tag failed.
*/
public static DefineSceneAndFrameLabelDataTag parse(final RecordHeader header, final SWFBinaryParser parser) throws SWFParserException {
final EncodedU32 sceneCount = EncodedU32Parser.parse(parser, "DefineSceneAndFrameLabelData::SceneCount");
final List<SceneName> sceneNames = new ArrayList<SceneName>();
for (int i=0;i<sceneCount.value();i++) {
sceneNames.add(SceneNameParser.parse(parser, String.format("DefineSceneAndFrameLabelData::SceneNames[%d]", i)));
}
final EncodedU32 frameLabelCount = EncodedU32Parser.parse(parser, "DefineSceneAndFrameLabelData::FrameLabelCount");
final List<FrameLabel> frameLabels = new ArrayList<FrameLabel>();
for (int i=0;i<frameLabelCount.value();i++) {
frameLabels.add(FrameLabelsParser.parse(parser, String.format("DefineSceneAndFrameLabelData::FrameLabels[%d]", i)));
}
return new DefineSceneAndFrameLabelDataTag(header, sceneCount, new SceneNameList(sceneNames), frameLabelCount, new FrameLabelList(frameLabels));
}