OK!!! I think I got it figured out. I used this coding. I typed in what I put in for each movie clip, and what I put in for each frame. Like whatever code is under FRAME 1 is going to be in FRAME 1. I also included the instance names and everything.
So does it look right to you?
frame 1 {
_root.onLoad = function () {
cannon._rotation = 90;
barBounds = bar.getBounds(_root);
var v4 = 1;
var v3 = 0;
var v6 = 1;
var v7 = false;
var v2 = 0;
var v5 = false;
};
_root.onEnterFrame = function () {
if (Key.isDown(38)) {
cannon._rotation -= 2;
}
if (Key.isDown(40)) {
cannon._rotation += 2;
}
if (cannon._rotation > 90) {
cannon._rotation = 90;
}
if (cannon._rotation < -5) {
cannon._rotation = -5;
}
if (peg._x <= barBounds.xMin) {
propel = 1;
savepropel = propel;
}
if (propel == 1) {
peg._x += 3;
}
if (peg._x >= barBounds.xMax) {
propel = -1;
savepropel = propel;
}
if (propel == -1) {
peg._x -= 3;
}
if (propel == 0) {
++peg._x;
--peg._x;
}
if (Key.isDown(32)) {
propel = 0;
speed = (peg._x - barBounds.xMin) / 16;
duplicateMovieClip('ball', 'ball' + i, i);
++i;
fired = true;
}
if (!Key.isDown(32)) {
if (fired == true) {
fired = false;
propel = savepropel;
}
}
};
}
movieClip 2 {
}
movieClip 4 {
}
instance ball of movieClip 4 {
onClipEvent (load) {
grav = -6;
speed = _root.speed;
_rotation = _root.cannon._rotation;
if (_name == 'ball') {
_x = -2000;
} else {
_x = _root.cannon._x;
_y = _root.cannon._y;
}
}
onClipEvent (enterFrame) {
_y = _y + grav;
++grav;
if (_rotation > 180) {
_y = _y + speed * Math.cos(0.0174532925199433 * _rotation);
_x = _x - speed * Math.sin(0.0174532925199433 * _rotation);
} else {
_y = _y - speed * Math.cos(0.0174532925199433 * _rotation);
_x = _x + speed * Math.sin(0.0174532925199433 * _rotation);
}
if (_x > Stage.width or _x < 0 or _y > Stage.height or _y < 0) {
this.removeMovieClip();
}
}
}
movieClip 6 {
}
movieClip 8 {
}
movieClip 10 {
}
}
I did this based on the cannon that was featured on page one.