I didn't actually look at your code, but I did write some of my own. You can modify this to fit your game. As you can see I only had one log in my test file but you should be able to figure out how to get all of the logs to call the same function.
ActionScript Code:
// Keys
Key.addListener(frog);
frog.onKeyDown = function() {
if (this.keyed == 0) {
this.keyed = 1;
currentKey = Key.getCode();
this.getKey(currentKey);
}
};
frog.onKeyUp = function() {
this.keyed = 0;
};
frog.getKey = function(keys) {
if (keys == 37) {
frog.move(1);
}else if (keys == 38) {
frog.move(3);
}else if (keys == 39) {
frog.move(2);
}else if (keys == 40) {
frog.move(4);
}
};
frog.move = function(dir) {
switch(dir) {
case 1:
// Left
this._x -= 25;
break;
case 2:
// right
this._x += 25;
break;
case 3:
// up
this._y -= 50;
break;
case 4:
// down
this._y += 50;
break;
}
};
frog.changeX = function(x) {
// frogs position changed by object
// it is sitting on
this._x += x;
};
log.speed = 5;
log.onEnterFrame = function() {
// move log
this._x += this.speed;
// look for frog
if (this.hitTest(frog)) {
// change frogs x position
frog.changeX(this.speed);
}
};
all of this code is on the main timeline