That's the one! Good book. He calls the expanding box thing a zero energy system (as the overall width of all the boxes put together never changes)..
Here's the script I updated from MX to MX 2004 - now, you'll just have to downdate it to F5.. lol..
PHP:<?php
//width you want each box to be
var baseSize:Number = 150;
// play around with these 2.
var damping:Number = .6;
var easeSpeed:Number = .2;
// number of boxes on stage..
var maxNo:Number = 3;
// number pixels between each box.
var bufferSpace:Number = 2;
for (var i = 0; i < maxNo; i++) {
var box:MovieClip = this["box" + i + "_mc"];
box.speed = 0;
box.num = i;
box.maxNo = maxNo;
box.boost = 60;
box.antiboost = (box.boost * -1) / (maxNo - 1);
box.useHandCursor = false;
box.onRollOver = function() {
this.onEnterFrame = function() {
for (var i = 0; i < this.maxNo; i++) {
if (i == this.num) {
this.speed += this.boost;
} else {
this._parent["box" + i + "_mc"].speed += this.antiboost;
}
}
};
};
box.onRollOut = function() {
delete this.onEnterFrame;
};
}
onEnterFrame = function () {
for (var i = 0; i < maxNo; i++) {
var box:MovieClip = this["box" + i + "_mc"];
box.speed = box.speed * damping + (baseSize - box._width) * easeSpeed;
box._width += box.speed;
if (i > 0) {
box._x = this["box" + (i - 1) + "_mc"]._x + this["box" + (i - 1) + "_mc"]._width + bufferSpace;
}
}
};
?>
By the way (inappropriate place, I know, but since I'm typing..), just saw your post in marketplace and thought I'd say if you ever need freelance flash work done, please keep me in mind (http://www.onebyonedesign.com). Unfortunately, my little gig with the US Navy prevents me from making a larger commitment than occasional freelancer, but just something to keep in the back of your mind.
d.
___________________
obod | weapons of mass dysfunction

