PDA

View Full Version : stop scaling



ditti
June 8th, 2005, 09:55 AM
Hello!
I have a movieclip that I want to be scaled to 400. After that I donīt want it to scale anymore. How can I stop it going back to itīs original value and scale again and again. I have the as in "On enter frame", I donīt want a button to be pressed to start scaling.

pom
June 8th, 2005, 11:14 AM
I don't understand. Do you want to stop scaling, or scale back and forth?

stringy
June 8th, 2005, 01:49 PM
use an if statement and delete this.onEnterFrame

ditti
June 8th, 2005, 05:34 PM
Hello again!
I have a movieclip with this as


onClipEvent (load) {
this._x = -40;
this._y = 20;

var scale = 1;
_xscale = _yscale=1;
}
onClipEvent (enterFrame) {
if (this._x>=-60 && this._x<=180) {
this._x += 5;
this._y += 3;
scale += 5;
if (scale>400) {
scale = 1;

}
}
_xscale = _yscale= scale;
}


After rhe movieclip has moved and scaled I want it to move and scale back to the beginning. Can someone help me with that?

nathan99
June 8th, 2005, 05:50 PM
:)

ditti
June 8th, 2005, 08:03 PM
Thank you Nathan99, yout fla was good, but I didnīt got my problem solved to get my movieclip back to its original position. I attach my fla so itīs easier to understand what I mean. I want the movieclip back to position x=-40, y=20 and scaled down to itīs original size. Is it possible without a button to be pressed?

scotty
June 9th, 2005, 02:48 AM
onClipEvent (load) {
this._x = -40;
this._y = 20;
var scale = 1;
_xscale = _yscale=1;
var d = 1;
}
onClipEvent (enterFrame) {
this._x += 5*d;
this._y += 3*d;
scale += 5*d;
if (this._x>=180) {
d = -1;
}
_xscale = _yscale=scale;
}
But you better put the code in a frame so you can delete the onEnterFrame like stringy has said :)

scotty(-: