Forum Topic: Syntax Error, Flash mx 2004 pro

(320 views • 11 replies)

This topic is 1 page long.

<< < > >>
Questioning

Wrongfire

Reply To Post Reply & Quote

Posted at: 12/7/05 06:22 PM

Wrongfire LIGHT LEVEL 07

Sign-Up: 10/12/04

Posts: 22

I need some help with a code. im trying to make a sidescroller. I got this code online. whats wrong with it? says that the syntax error is on line 7, function moveMan()
any help is appreciated.

stop();
function initGame() {
attachMovie("man", "man", 999999);
man._x = 275;
man._y = 350;
}
funtion moveMan() {
if (man._currentFrame>4) {
dx = 0;
} else if (Key.isDown(Key.RIGHT)) {
dx = dgspeed;
man.gotoAndStop("right");
} else if (Key.isDown(Key.LEFT)) {
dx = -dgspeed;
man.gotoAndStop("left");
} else {
dx = 0;
man.gotoAndStop("normal")
}
rect._x += dx;
if (man._x<45) {
man._x = 45;
}
if (man._x<650) {
man._x = 650;
}
if (bgspeed<5) {
bgspeed += .05;
}
}


None

Blaze

Reply To Post Reply & Quote

Posted at: 12/7/05 06:26 PM

Blaze LIGHT LEVEL 22

Sign-Up: 08/04/05

Posts: 6,957

it says funtion.

change it to function.


Happy

Wrongfire

Reply To Post Reply & Quote

Posted at: 12/7/05 06:27 PM

Wrongfire LIGHT LEVEL 07

Sign-Up: 10/12/04

Posts: 22

omg...lol
ok thanks


None

Blaze

Reply To Post Reply & Quote

Posted at: 12/7/05 06:30 PM

Blaze LIGHT LEVEL 22

Sign-Up: 08/04/05

Posts: 6,957

At 12/7/05 06:27 PM, Wrongfire wrote: omg...lol
ok thanks

Dont know how you didnt see that. XD but, its okay. We all make mistakes.

Good luck with your platformer, even though i'd rather make my own code.

.:Blaze:.


None

Wrongfire

Reply To Post Reply & Quote

Posted at: 12/7/05 06:41 PM

Wrongfire LIGHT LEVEL 07

Sign-Up: 10/12/04

Posts: 22

thanks. but i have another problem, if anyone knows how to fix it.
Ok i have my char made with all the codes to turn left right and to move there.
and on this website it says to make a circle, and make its alpha=0. the code for this circle is:

onClipEvent(load) {
_root.initGame();
}
onClipEvent(enterFrame) {
_root.moveMan();
}

problem is, it sends my character to the corner of the screen, anyone know why?


None

rEvolution27

Reply To Post Reply & Quote

Posted at: 12/7/05 06:46 PM

rEvolution27 LIGHT LEVEL 04

Sign-Up: 10/16/05

Posts: 829

yes that's exactly what it does...

man._x = 275;
man._y = 350;

i think you need to learn actionscript, or your game is going nowhere


Happy

Wrongfire

Reply To Post Reply & Quote

Posted at: 12/7/05 06:49 PM

Wrongfire LIGHT LEVEL 07

Sign-Up: 10/12/04

Posts: 22

lol, yeah, it would be nice to know... cant find a place to learn it. those are coordinates right? if so then i can figure this out. thanks.


None

Blaze

Reply To Post Reply & Quote

Posted at: 12/7/05 06:51 PM

Blaze LIGHT LEVEL 22

Sign-Up: 08/04/05

Posts: 6,957

At 12/7/05 06:49 PM, Wrongfire wrote: lol, yeah, it would be nice to know... cant find a place to learn it. those are coordinates right? if so then i can figure this out. thanks.

yes. _x is the X line. Which is from right to left 0 Being right.
_y is top down. 0 being top.

You can always try AS: MAIN to learn AS.


Angry

Wrongfire

Reply To Post Reply & Quote

Posted at: 12/7/05 06:58 PM

Wrongfire LIGHT LEVEL 07

Sign-Up: 10/12/04

Posts: 22

aww, i thought i figured it out. i put in

man._x = 18.0;
man._y = 167.5;

as the new coordinates. but when i test movie, hes still in that corner. this website lies, says it should work perfectly... Thanks for that link, if i cant figure it out ill just delete it all and remake using AS: Basic


None

Blaze

Reply To Post Reply & Quote

Posted at: 12/7/05 07:02 PM

Blaze LIGHT LEVEL 22

Sign-Up: 08/04/05

Posts: 6,957

At 12/7/05 06:58 PM, Wrongfire wrote: as the new coordinates. but when i test movie, hes still in that corner. this website lies, says it should work perfectly... Thanks for that link, if i cant figure it out ill just delete it all and remake using AS: Basic

no prob. If you ever have more problems, keep posting in the Flash Forum. I'll try to answer.

.:Blaze:.


None

Wrongfire

Reply To Post Reply & Quote

Posted at: 12/7/05 07:10 PM

Wrongfire LIGHT LEVEL 07

Sign-Up: 10/12/04

Posts: 22

Ok cool. I just started over. gonna try actually LEARNING actionscript before i start making game.


None

Blaze

Reply To Post Reply & Quote

Posted at: 12/7/05 07:12 PM

Blaze LIGHT LEVEL 22

Sign-Up: 08/04/05

Posts: 6,957

At 12/7/05 07:10 PM, Wrongfire wrote: Ok cool. I just started over. gonna try actually LEARNING actionscript before i start making game.

Sweet, thats better. I learnt by some of the tuts on AS: Main, and now working on a game all by myself mastering my own techniques. Good luck!


All times are Eastern Standard Time (GMT -5) | Current Time: 12:14 PM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!