SWFReader swfReader = getSWFReader(problems);
if (swfReader == null)
return false;
ISWF swf = swfReader.getSWF();
if (swf == null)
return false;
if (symbol == null)
{
baseClassQName = CORE_PACKAGE + ".MovieClipLoaderAsset";
if (scaling)
{
problems.add(new EmbedMovieScalingNoSymbolProblem(location));
}
}
else
{
symbolTag = getSWFTag(swfReader, symbol, problems);
if (symbolTag == null)
{
problems.add(new EmbedMissingSymbolProblem(location, source, symbol));
return false;
}
if (scaling)
{
if (!(symbolTag instanceof DefineSpriteTag))
{
problems.add(new EmbedBadScalingGridTargetProblem(location, symbol));
return false;
}
}
if (swf.getFrameCount() > 1)
baseClassQName = CORE_PACKAGE + ".MovieClipLoaderAsset";
else
baseClassQName = getAssociatedClass(symbolTag);
if (symbolTag instanceof DefineFont2Tag)
{
flexFontInfo = new FlexFontInfo(((DefineFont2Tag)symbolTag).isFontFlagsBold(), ((DefineFont2Tag)symbolTag).isFontFlagsItalic());
}
else if (symbolTag instanceof DefineFont4Tag)
{
flexFontInfo = new FlexFontInfo(((DefineFont4Tag)symbolTag).isFontFlagsBold(), ((DefineFont4Tag)symbolTag).isFontFlagsItalic());
}
}
Rect swfSize = swf.getFrameSize();
if (swfSize != null)
{
swfWidth = swfSize.getWidth() / ISWFConstants.TWIPS_PER_PIXEL;
swfHeight = swfSize.getHeight() / ISWFConstants.TWIPS_PER_PIXEL;
}