PDA

View Full Version : Syntax Problems



Ximenao
June 8th, 2006, 12:08 AM
Hi. Plz someone help me.
I've been trying to program a simple bug zapper game, I mean, I've done a few games before, so this should be simple enough, right? But everytime I test the movie, the outputpalette gives me this message:

**Error** Scene=Game, layer=Codeing, frame=1:Line 152: '{' expected
function randRange(minNum:Number, maxNum:Number):Number {

**Error** Scene=Game, layer=Codeing, frame=1:Line 154: Unexpected '}' encountered
}

The section of the code that's causing the trouble is this:

/* create a function that returns a random integer between two specified numbers.
This allows you to add some subtle differences in size and speed for the movie clips on the Stage. */
function randRange(minNum:Number, maxNum:Number):Number {
return (Math.floor(Math.random()*(maxNum-minNum+1))+minNum);
}

Can anyone help me?

TheCanadian
June 8th, 2006, 12:14 AM
Publish to AS2 or remove the data types.