-
onClipEvent (enterFrame) {
if (Key.isDown(39)) {
setProperty(_root.auto, _rotation, getProperty(_root.auto, _rotation)+(speed/3));
}
if (Key.isDown(37)) {
setProperty(_root.auto, _rotation, getProperty(_root.auto, _rotation)-(speed/3));
}
if (Key.isDown(38)) {
if (Number(speed)<50) {
speed = speed+15;
}
} else {
if (Number(speed)>7) {
speed = speed-8;
} else {
if (Number(speed)>0) {
speed = speed-1;
}
}
}
if (Key.isDown(40)) {
if (Number(speed)>30) {
speed = speed-30;
} else {
speed = 0;
}
}
setProperty(_root.auto, _x, getProperty(_root.auto, _x)+(Math.cos(_root.auto._rotation)*(speed/10)));
setProperty(_root.auto, _y, getProperty(_root.auto, _y)+(Math.sin(_root.auto._rotation)*(speed/10)));
}
The last part shows the script for the movement calculated by the rotation of the car. but when i script it this way the rotation does not fit to the movement!
I changed somethin in the last part:
...
...
setProperty(_root.auto, _x, getProperty(_root.auto, _x)+(Math.cos(_root.auto._rotation/50)*(speed/10)));
setProperty(_root.auto, _y, getProperty(_root.auto, _y)+(Math.sin(_root.auto._rotation/50)*(speed/10)));
}
the /50 made it work a bit, but the movement does not really fit!! why??????? dl the movie: http://www.myfav.de/pics/formel1.zip
PLEASE ANSWER, THX
-
Not PWD
Well,
in Key.isDown (Key.40)
"40" isn't a key, it's a number. You should have something like "UP", "DOWN", "RIGHT", "LEFT", "SHIFT", The list goes on and on.
-
Well thats workin fine because every key has a specific number. The thing I wrote up there was my only problem.
Download the movie and u will see!
OH it is:
Key.isDown(40) and not Key.isDown(key.40)!!!!
-
PLEASE HELP ME!!!!!!!!!!!!!!!!!
-
Not PWD
Well, once again, I show my miracules powers to make an ass of my self on something I don't know. :-D
-
-
please help me!!!!!!!!!!!
ISN'T here anybody who knows that?
-
Not PWD
hmm...
All I can say is that it is in your best intrest to take this to the actionscript section. If your blamed for double posting, tell 'em I sent you.
-
Senior Member
All you people that expect us to open a Flash 6 file. Why don't you supply the Flash MX program download as well so we can open the fla and look at it.
But Arrrrr there's another thing you could do. Go to the Flash MX forrum.
-
Not PWD
Wow, someone has an attitude to curve.
This isn't a MX specific problem. And why don't you find the MX download on your own? Stop griping, just live with it. You'll get it eventually.
By the way, what's bothering you today?
-
look this is...
the number is:
if (Key.getCode(40)){
//do anything
}
and if you write:
if (Key.isDown(40)) {
//do anything
}
it is incorrect!
you could write :
if (Key.isDown("ENTER")) {
//do anything
}
it would be correct
my english is ****, isn't it? (I'm an austriam boy)
-
WTF WTF WTF DONT U UNDERSTAND ME?????? THEY KEYS WOOOOOORK! DOWNLOAD THE MOVIE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1
the problem is the wrong movement what does not fit to the rotation!!!!!!!
-
Not PWD
Hey...
No aditude. It was a mis-understanding.
For that answer, you need to go to either the physics department, or the action script department. We don't usually answert those kinds of questions.
-
-
Not PWD
It's ok. Sometimes we all lose are cool. Just gotta keep each other in check.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|