ForumsProgramming ForumErrors 1108 and 1046

1 3394
P051D3N
offline
P051D3N
25 posts
Nomad

I have a problem.
Whenever I try to use any code to the format of:

var ourShip:Ship = new Ship();
stage.addChild(ourShip);

it doesn't work and displays the error messages

1046: Type was not found or was not compile time constant: Ship.
1108: Call to a possibly undefined method Ship.

I am using Flash CS5 and AS3. If anyone could help I would be very greatful.

  • 1 Reply
Darkroot
offline
Darkroot
2,763 posts
Peasant

You need class linkage. When you convert to symbol go to advanced and give it a class name. Like the symbol is Ship and the class is ShipPew
Then your code would be..

var _Ship = new ShipPew();
addChild(_Ship);

Showing 1-1 of 1