I tried to make a game in Flash CS3. I converted the thing I want to script into a movie clip symbol, double click at it and wrote down these:
onClipEvent (load) {
power = 0.3;
yspeed = 0;
xspeed = 0;
friction = 0.95;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
xspeed -= power;
}
if (Key.isDown(Key.RIGHT)) {
xspeed += power;
}
if (Key.isDown(Key.UP)) {
yspeed -= power;
}
if (Key.isDown(Key.DOWN)) {
yspeed += power;
}
xspeed *= friction;
yspeed *= friction;
_y += yspeed;
_x += xspeed;
}
When I checked the mistake that I might make, it kept telling me:
1087: Syntax error: extra characters found after end of program. onClipEvent (load) {
Can somebody tell me how to solve this?