classes
hey everyone, so far actionscript hasnt been my biggest friend every line i type returns me with a error but that's likely me ^.^.
anyway i'm trying to load a class into my main.AS which is linked to my flash background. however errors errors and more errors floating my screen.
<code>
package
{
import flash.net.URLRequest;
import flash.display.*;
import flash.events.*;
public class Main extends MovieClip
{
var playerShip:Ship = new Ship();
//var enemyShip = new mc_EnemyShip();
function Main()
{
addChild(playerShip);
//trace(Ship);
}
}
}
</code>
i'm not sure whether to use the trace function or not or how to have this thing load my class at all if i run this i get the following as output: TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Ship()
at Main()
thanks for the help guys this is really frustrating me ![]()