I asked a question the other day and it taught me a fair bit about display objects and stuff. I have another problem though.
This is my document class :
package
{
import flash.display.MovieClip;
import flash.display.Stage;
public class Engine extends MovieClip
{
public function Engine()
{
var calling:Callitems = new Callitems(cat, BluKnife)
stage.addChild(calling);
}
}
}
cat
and BluKnife
are movieclips in my library with as3 linkage to those names.
Now here is the Callitems
Class
package
{
import flash.display.MovieClip;
import flash.display.Stage;
import flash.display.InteractiveObject;
public class Callitems extends MovieClip{
public function Callitems(Enemy1, Enemy2)
{
var knife:Enemy1 = new Enemy1();
this.addChild(knife);
knife.x = 200;
var ct:Enemy2 = new Enemy2();
this.addChild(ct);
}
}
}
Now my problem is that when I wasn't giving Callitems
arguments and was instead just making Enemy1
, cat
and making Enemy2
, Bluknife
both of those movieclips were added to the stage as expected. But now that I'm trying to make Callitems
take arguments so that I can place different clips at certain times I'm getting the following error:
1046: Type was not found or was not a compile-time constant: Enemy1. 1046: Type was not found or was not a compile-time constant: Enemy2.
Thanks everyone, any help is much appreciated
Edit: I did search this site for that same error, but I don't understand the problem in this context, sorry!