importNode = ImportNode.buildImportNode("flash.utils.ByteArray");
packageContents.addItem(importNode);
// generate the byte array class
String byteArrayClassName = data.getQName() + byteArrayNamePostfix;
ClassNode classNodeByteArray = new ClassNode(new IdentifierNode(byteArrayClassName));
classNodeByteArray.setBaseClass(new IdentifierNode("ByteArrayAsset"));
classNodeByteArray.setNamespace(new NamespaceIdentifierNode(INamespaceConstants.public_));
packageContents.addItem(classNodeByteArray);
// generate the movie class
String movieClassName = data.getQName();
ClassNode classNodeMovie = new ClassNode(new IdentifierNode(movieClassName));
classNodeMovie.setBaseClass(new IdentifierNode(getBaseClassName()));
classNodeMovie.setNamespace(new NamespaceIdentifierNode(INamespaceConstants.public_));
packageContents.addItem(classNodeMovie);
ScopedBlockNode classNodeMovieContents = classNodeMovie.getScopedNode();
// generate: private static var bytes:ByteArray = null;
VariableNode variableNodeBytes = new VariableNode(new IdentifierNode("bytes"));
variableNodeBytes.setNamespace(new NamespaceIdentifierNode(INamespaceConstants.private_));
variableNodeBytes.addModifier(new ModifierNode(IASKeywordConstants.STATIC));
variableNodeBytes.setType(null, new IdentifierNode("ByteArray"));
ASToken assignToken = new ASToken(ASTokenTypes.TOKEN_OPERATOR_ASSIGNMENT, -1, -1, -1, -1, "=");
ASToken nullToken = new ASToken(ASTokenTypes.TOKEN_KEYWORD_NULL, -1, -1, -1, -1, IASKeywordConstants.NULL);
LiteralNode nullNode = new LiteralNode(LiteralType.NULL, nullToken);
variableNodeBytes.setAssignedValue(assignToken, nullNode);
classNodeMovieContents.addItem(variableNodeBytes);
// build the constructor
IdentifierNode constructorNameNode = new IdentifierNode(movieClassName);
constructorNameNode.setReferenceValue(classNodeMovie.getDefinition());
FunctionNode constructorNode = new FunctionNode(null, constructorNameNode);
constructorNode.setNamespace(new NamespaceIdentifierNode(INamespaceConstants.public_));
ScopedBlockNode constructorContents = constructorNode.getScopedNode();
// generate: super();