0
votes

I am getting a 1180 and 1046 compiler error when working with AS3.
I am trying to create a thing that places a car on the stage. Very simple, but I can't get it to work.
I have a movie clip symbol named Car, with an AS linkage MyCar3. Here is my code:

var MyCar3:Car = new Car();
stage.addChild(MyCar3);

MyCar3.x = 500;
MyCar3.y = 350;

My compiler says

Scene 1, Layer 'Layer 1', Frame 1, Line 1 1046: Type was not found or was not a compile-time constant: Car.

and

Scene 1, Layer 'Layer 1', Frame 1, Line 1 1180: Call to a possibly undefined method Car.

1

1 Answers

1
votes

That should work:

var car:MovieClip = new MyCar3();
stage.addChild(car);
car.x = 500;
car.y = 350;

Remember that AS linkange is actual name of the class that generates the object that you can attach to the screen.