…Of an action script that would tween a movie clip so that it gradually gets bigger? So far I’ve been action scripting by example; composing is a killer for me.
For beginners, but this on the movie clip…
[AS]
//when clip loads
onClipEvent(load) {
//set this clips width to 10
this._width = 10
//set this clips height to 10
this._height = 10
//set variable to hold the speed
speed = 5
}
//every time clip enters the frame
onClipEvent(enterFrame){
//increase the width by the current speed
//this basically says this._width = this._width+value of speed variable
this._width += speed
//do the same for the height
this._height += speed
}[/AS]
Theres your start… now you take it from there :thumb:
Thank you!
try this as well,
onClipEvent(load){
speed = 5; // Change this variable if you want.
}
onClipEvent(enterFrame){
this._xscale += speed;
this._yscale += speed;
}
This should work I think
Thanks! They both work great! But there’s a little bit of distortion when I use the former one. The animation starts off somewhat narrow then gets wider. It helped when I adjusted the width. How come this is so?
…And how do you make the animation stop after a certain point?
It all depends on the height and width of your clip on how it will scale, so you will need to adjust it to work.
And to stop the animation use an if statement… something like
[AS]
//if the width is greater than or equal to the final width number
if (this._width >= finalWidthNumber ){
//keep the width at the final width number
this._width = finalWidthNumber;
}[/AS]
Deleted.