Combined Code
frame 1 {
speed = 0;
angle = 0;
lum = 1;
}
movieClip 12 {
}
movieClip 15 {
}
movieClip 17 {
}
movieClip 19 {
}
movieClip 21 {
}
movieClip 22 {
instance Car_Item of movieClip 21 {
onClipEvent (enterFrame) {
radian = 0.0174532925199433 * _root.angle;
_parent._x += _root.speed * Math.cos(radian);
if (550 < _parent._x) {
_parent._x = 550;
}
if (_parent._x < 0) {
_parent._x = 0;
}
_parent._y += _root.speed * Math.sin(radian);
if (400 < _parent._y) {
_parent._y = 400;
}
if (_parent._y < 0) {
_parent._y = 0;
}
_parent._rotation = _root.angle;
}
}
}
button 30 {
on (press) {
if (speed < 3) {
++speed;
}
}
}
button 37 {
on (press) {
if (-2 < speed) {
--speed;
}
}
}
button 42 {
on (press) {
anglemous = -5;
}
on (release, releaseOutside) {
anglemous = 0;
}
}
button 47 {
on (press) {
anglemous = 5;
}
on (release, releaseOutside) {
anglemous = 0;
}
}
button 53 {
on (press) {
if (lum == 1) {
_root.mycar.lumiere._visible = 0;
_root.mycar.lumbrake._visible = 0;
lum = 0;
} else {
_root.mycar.lumiere._visible = 1;
_root.mycar.lumbrake._visible = 1;
lum = 1;
}
}
}
movieClip 67 {
frame 1 {
stop();
}
frame 2 {
stop();
}
frame 3 {
stop();
}
frame 4 {
stop();
}
frame 5 {
stop();
}
frame 6 {
stop();
}
}
movieClip 68 {
instance of movieClip 67 {
onClipEvent (enterFrame) {
if (_root.speed == -2) {
gotoAndPlay(1);
}
if (_root.speed == -1) {
gotoAndPlay(2);
}
if (_root.speed == 0) {
gotoAndPlay(3);
}
if (_root.speed == 1) {
gotoAndPlay(4);
}
if (_root.speed == 2) {
gotoAndPlay(5);
}
if (_root.speed == 3) {
gotoAndPlay(6);
}
}
}
}
frame 3 {
if (Key.isDown(Key.RIGHT)) {
angleclav = 5;
} else {
if (Key.isDown(Key.LEFT)) {
angleclav = -5;
}
}
if (Key.isDown(Key.UP)) {
if (speed < 3) {
++speed;
}
}
if (Key.isDown(Key.DOWN)) {
if (-2 < speed) {
--speed;
}
}
angle += anglemous + angleclav;
angleclav = 0;
prevFrame();
play();
}