Welcome to Dream.In.Code
Getting Help is Easy!

Join 105,764 Programmers for FREE! Ask your question and get quick answers from experts. There are 1,637 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



syntax error

 
Reply to this topicStart new topic

syntax error, help?

rodjav305
post 29 Apr, 2008 - 05:26 AM
Post #1


New D.I.C Head

*
Joined: 14 Apr, 2008
Posts: 4

onClipEvent(load){

moveSpeed=10;

}


onClipEvent (enterFrame) {


if(Key.isDown(Key.RIGHT)) {
this._x+=moveSpeed;
} else if(Key.isDown(Key.LEFT)) {
this._x-=moveSpeed;
}
if(Key.isDown(Key.DOWN)) {
this._y+=moveSpeed;
} else if(Key.isDown(Key.UP)) {
this._y-=moveSpeed;
}
}
User is offlineProfile CardPM

Go to the top of the page


KYA
post 29 Apr, 2008 - 05:41 AM
Post #2


#include <nerd.h>

Group Icon
Joined: 14 Sep, 2007
Posts: 2,432



Thanked 13 times

Dream Kudos: 1150
My Contributions


Where? What error? Syntax errors are the easiest to fix, especially if its a variable you created yourself.
User is offlineProfile CardPM

Go to the top of the page

rodjav305
post 29 Apr, 2008 - 12:50 PM
Post #3


New D.I.C Head

*
Joined: 14 Apr, 2008
Posts: 4

QUOTE(KYA @ 29 Apr, 2008 - 05:41 AM) *

Where? What error? Syntax errors are the easiest to fix, especially if its a variable you created yourself.


it said after the the onClip event the first one
im basically trying to learn how a make a game on flash so im really a noob at this=/
User is offlineProfile CardPM

Go to the top of the page

.Maleficus.
post 29 Apr, 2008 - 07:38 PM
Post #4


D.I.C Head

**
Joined: 7 Mar, 2008
Posts: 117



Thanked 2 times
My Contributions


So this is ActionScript? I don't know anything about it, and I can't tell much from your code, but here it goes.

You have a variable called moveSpeed in your onClipEvent(load) method. It also looks like you declared it in the onClipEvent(load) method. After the method finishes, it trashes all your instance variables. SO.... Unless moveSpeed is a global variable, it doesn't exist in the onClipEvent(enterFrame) method.

So basically, you're trying to access a variable that doesn't exist (I think). If you can, post the rest of your code and the error message you're getting.
User is offlineProfile CardPM

Go to the top of the page

rodjav305
post 30 Apr, 2008 - 04:59 AM
Post #5


New D.I.C Head

*
Joined: 14 Apr, 2008
Posts: 4

thanks for the help i appreciate it
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 8/21/08 02:15PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month