Programming help please! page 4

90 posts

Flag Post
Originally posted by Jabor:

You’re missing a close brace at the end of the class.

So there should be 3 close brackets at the end of the ship code?

 
Flag Post

Errors: Statement block must be terminated by ‘}’ line 2
1.class Ship extends MovieClip
2.{
3.var velocity;
4.var shootLimiter;
5.var enemyTimer;

Syntax error. Line 51

50.}
51.}
52.}

class Ship extends MovieClip
{
var velocity;
var shootLimiter;
var enemyTimer;


function onLoad()
{
velocity=15;
shootLimiter=0;
enemyTimer=0;
}

function onEnterFrame()
{

if( Key.isDown(Key.LEFT))
		{ 
			_x -= velocity; 
		}
		if( Key.isDown(Key.RIGHT))
		{
			_x += velocity; 
		}
		if( Key.isDown(Key.UP))
		{
			_y -= velocity; 
		}
		if( Key.isDown(Key.DOWN))
		{
			_y += velocity; 
		}

shootLimiter +=1;
if( Key.isDown(Key.SPACE)&& shootLimiter > 8 )
{	
shootlimiter=0;
var missile = root.attachMovie( "Missile" , "Missile" + _root.getNextHighestDepth() , _root.getNextHighestDepth() );
missile.x = x ;
missile.y = y;
}

 enemyTimer += 1;

if(enemyTimer > 60)
{
enemyTimer = 0;
root.attachMovie("EnemyShip", "EnemyShip"+root.getNextHighestDepth(), _root.getNextHighestDepth());
} 
}
}

The ship won’t move and won’t shoot.

 
Flag Post

Does anyone know what this error means? 1046:

Type was not found or was not a compile-time constant: button.

It’s not important but if anyone knows could you tell me?

 
Flag Post

The class was not found, maybe you spelled it wrong or it is in another folder?

 
Flag Post
Originally posted by SavageWolf:

The class was not found, maybe you spelled it wrong or it is in another folder?

Wow I’m stupid…. Thanks!

 
Flag Post

I thank all of you who tried to help me with this game I was trying to make, I just wasn’t able to make the game work and my Adobe Flash trial ends in 5 days so… I guess this is the end of my game making, thanks to all of you who took time to actually help me but I just don’t think I’m up to making good flash games so I’m going to stop making games but I will still be on Kongregate playing and enjoying games. Goodbye.

 
Flag Post

Isn’t there a free compiler out there?

 
Flag Post
Originally posted by Feltope:

Isn’t there a free compiler out there?

FlashDevelop is good.

 
Flag Post

I didn’t mean IDE’s (I love FlashDevelop). I meant command line compilers for actionScript.

I found 2 I didn’t research them at all though I have heard of haxe before I don’t know anything about it. You can check them out and see if they fit what your looking for to continue developing in AS.

http://haxe.org/
http://www.mtasc.org/

 
Flag Post

FlashDevelop can compile

 
Flag Post
Originally posted by fastcar25:

FlashDevelop can compile

I did not know that I usually don’t mind having flash open. I see you can use the flex sdk for compiling. nice.

thanks for the info.

 
Flag Post

Wow thanks to everyone who is helping me…

 
Flag Post

If it uses actonscript, it would’t work because I have already used up the trial version of Adobe.
Would it still work?

 
Flag Post

Yes. Forget about Flash CS#, FlashDevelop is, in my opionion, far superior to Flash CS, codewise atleast. It takes some getting used to, though.

 
Flag Post

It takes some getting used to, though.

The trick is to try and completely forget how you used to work in Flash CS#. If you keep thinking in terms of MovieClips and frames you’ll struggle unnecessarily.