I was reading about prototype last night, and thought I'd give it my first try. Now, I have a question...there are 8 instances of a MC on the stage, named bar1-bar8...and I have them growing, in succession, in _xscale...can anyone tell me why the code below makes each bar grow quicker than the last:
code:
onLoad = function () {
_root.i = 1;
_root.speed = 10;
};
MovieClip.prototype.bargrow = function() {
if (_root["bar"+i]._xscale<=200) {
_root["bar"+i]._xscale += _root.speed;
}
};
_root["bar"+i].onEnterFrame = function() {
_root["bar"+i].bargrow();
if (_root["bar"+i]._xscale>=100) {
i++;
}
};
if this is really simple, and I look stupid, can I say my girlfriend wrote it? ;) <just don't tell her I said that> :)
thanks, and I've attached a sample of the file if you want to see it.
Adam
