Hey can somebody chek this code out, for some reason it has no syntax errrors but it does not make my character(Sonic) move.
This Code is in the actions frame on my Properties Layer Below that layer is the layer with sonic on it.
right now im just worried about making him move.
/////Moving left And Right/////
if (Key.isDown(Key.RIGHT)) {
if (_root.Sonic.Xspeed<30) {
_root.Sonic.Xspeed += 3;
}
_root.Sonic.Right = true;
} else if (Key.isDown(Key.LEFT)) {
if (_root.Sonic.Xspeed<30) {
_root.Sonic.Xspeed -= 3;
}
_root.Sonic.Right = false;
} else {
/////Friction/////
if (_root.Sonic.Rolling=false) {
_root.Sonic.Xspeed *= 0.7;
} else if (_root.Sonic.Rolling == true) {
_root.Sonic.Xspeed *= 0.9;
}
}
/////Where To Be/////
x=_root.Sonic._x+_root.Sonic.Xspeed
y=_root.Sonic._y+_root.Sonic.Zspeed
_root.Sonic._x=x
_root.Sonic._y=y
Is that all the code you have? If so, you should define ‘Xspeed’ first. And I don’t know what your fla looks like, but the way you build your code, you should have a 2nd frame that says ‘gotoAndPlay(1);’
Yeah the other way, in two frames was used in flash 5 and before, not that there’s anything wrong with that. I’m guessing you just hold an old tutorial or something.