I have created an assets.swf, in which I want to keep all my symbols. Then, I have created an Assets class which does the embedding. It looks like this:
public class Assets extends MovieClip
{
[Embed(source="assets.swf", symbol="MyBox")]
public static var MyBox:Class;
public function Assets()
{
}
}
Now, in some other class, I want to create a new box:
import com.company.Assets;
...
public function Game()
{
var myBox:MovieClip = new Assets.MyBox();
addChild(myBox);
}
I know this in incorrect, and I get "TypeError: Error #1007: Instantiation attempted on a non-constructor." How can I get access to the assets in the Assets class?