lelales
12-05-2005, 06:53 PM
I'm trying to do a simple elastic scaling function, but it doesn't work.
I have the following code:elasticscale=function(tar, accel, convert) {
xScale = xScale*accel+(tar-this._xscale)*convert;
yScale = yScale*accel+(tar-this._yscale)*convert;
this._xscale += xScale;
this._yscale += yScale;
};
then:mc.onEnterFrame=this.elasticsScale(100, 0,5, .4);
it works fine when placed on a clip, as follows:onClipEvent (load) {
this.elasticScale = function(tar, accel, convert) {
xScale = xScale*accel+(tar-this._xscale)*convert;
yScale = yScale*accel+(tar-this._yscale)*convert;
this._xscale += xScale;
this._yscale += yScale;
};
}
onClipEvent (enterFrame) {
this.elasticScale(100, 0.5, 0.4);
} but when I remove the code from the clip, change the syntax, and place it on a keyframe, it doesn't work.
here's my file: http://www.caillouette.com/sb_elastic.zip
thanks
I have the following code:elasticscale=function(tar, accel, convert) {
xScale = xScale*accel+(tar-this._xscale)*convert;
yScale = yScale*accel+(tar-this._yscale)*convert;
this._xscale += xScale;
this._yscale += yScale;
};
then:mc.onEnterFrame=this.elasticsScale(100, 0,5, .4);
it works fine when placed on a clip, as follows:onClipEvent (load) {
this.elasticScale = function(tar, accel, convert) {
xScale = xScale*accel+(tar-this._xscale)*convert;
yScale = yScale*accel+(tar-this._yscale)*convert;
this._xscale += xScale;
this._yscale += yScale;
};
}
onClipEvent (enterFrame) {
this.elasticScale(100, 0.5, 0.4);
} but when I remove the code from the clip, change the syntax, and place it on a keyframe, it doesn't work.
here's my file: http://www.caillouette.com/sb_elastic.zip
thanks