1. Import a picture, select the picture, press F8 to convert to a movie clip. Registration point is center point
2. Set the real case name "PIG" in the property panel
3, new layer, enter code:
Function FPIG () {if (! ss) {ss = -10; // If the SS variable is not defined, the value of the SS variable is 10-- ie the ratio of the X-axis that is changed each time.}} { _XScale = SS; // Continuously change the xscale value IF of PIG movie clip ((_xscale <= 0) || (_xscale> = 100)) {// If it is a positive reverse reverse switch to _xscale <= - 100 SS * = -1; // When the xscale value is less than 0 or greater than 100, multiply by -1, change the positive negative value of SS}}} Pig.onterFrame = function () {fput ();